summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mysql/psi/mysql_file.h2
-rw-r--r--include/mysql/psi/mysql_idle.h2
-rw-r--r--include/mysql/psi/mysql_stage.h2
-rw-r--r--include/mysql/psi/mysql_thread.h4
-rw-r--r--include/mysql/psi/psi.h4
-rw-r--r--include/mysql/psi/psi_abi_v1.h.pp2
-rw-r--r--mysql-test/suite/perfschema/include/disable_instruments.inc23
-rw-r--r--mysql-test/suite/perfschema/include/enable_instruments.inc23
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_setup.inc4
-rw-r--r--mysql-test/suite/perfschema/include/rpl_statements_truncate.inc15
-rw-r--r--mysql-test/suite/perfschema/include/sizing_auto.inc4
-rw-r--r--mysql-test/suite/perfschema/r/binlog_edge_row.result4
-rw-r--r--mysql-test/suite/perfschema/r/dml_setup_instruments.result6
-rw-r--r--mysql-test/suite/perfschema/r/func_file_io.result1
-rw-r--r--mysql-test/suite/perfschema/r/func_mutex.result1
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result220
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result220
-rw-r--r--mysql-test/suite/perfschema/r/innodb_table_io.result3
-rw-r--r--mysql-test/suite/perfschema/r/myisam_file_io.result1
-rw-r--r--mysql-test/suite/perfschema/r/ortho_iter.result42
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_event.result106
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_func.result106
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_proc.result106
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_table.result106
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_view.result106
-rw-r--r--mysql-test/suite/perfschema/r/privilege_table_io.result4
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result8
-rw-r--r--mysql-test/suite/perfschema/r/rpl_gtid_func.result2
-rw-r--r--mysql-test/suite/perfschema/r/rpl_statements.result244
-rw-r--r--mysql-test/suite/perfschema/r/setup_instruments_defaults.result40
-rw-r--r--mysql-test/suite/perfschema/r/sizing_default.result208
-rw-r--r--mysql-test/suite/perfschema/r/sizing_high.result60
-rw-r--r--mysql-test/suite/perfschema/r/sizing_low.result60
-rw-r--r--mysql-test/suite/perfschema/r/sizing_med.result60
-rw-r--r--mysql-test/suite/perfschema/r/sizing_off.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_idle.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_stages.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_statements.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_disable_waits.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_innodb.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_account.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_class.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_cond_inst.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_class.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_file_inst.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_host.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_class.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result6
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_actors.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_setup_objects.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_class.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_socket_inst.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stage_class.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statement_class.result2
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_hdl.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_table_inst.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_class.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_thread_inst.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_user.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_off.result4
-rw-r--r--mysql-test/suite/perfschema/r/start_server_on.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_off.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result4
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result4
-rw-r--r--mysql-test/suite/perfschema/t/aggregate.test1
-rw-r--r--mysql-test/suite/perfschema/t/disabled.def3
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate.test2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a.test2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_h.test2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_u.test2
-rw-r--r--mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test2
-rw-r--r--mysql-test/suite/perfschema/t/func_file_io.test1
-rw-r--r--mysql-test/suite/perfschema/t/func_mutex.test1
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test81
-rw-r--r--mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test81
-rw-r--r--mysql-test/suite/perfschema/t/myisam_file_io.test1
-rw-r--r--mysql-test/suite/perfschema/t/nesting.test6
-rw-r--r--mysql-test/suite/perfschema/t/ortho_iter.test4
-rw-r--r--mysql-test/suite/perfschema/t/rpl_statements-master.opt1
-rw-r--r--mysql-test/suite/perfschema/t/rpl_statements-slave.opt1
-rw-r--r--mysql-test/suite/perfschema/t/rpl_statements.test338
-rw-r--r--mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt29
-rw-r--r--mysql-test/suite/perfschema/t/setup_instruments_defaults.test61
-rw-r--r--mysql-test/suite/perfschema/t/sizing_default.cnf11
-rw-r--r--mysql-test/suite/perfschema/t/sizing_default.test22
-rw-r--r--mysql-test/suite/perfschema/t/view_table_io.test1
-rw-r--r--storage/perfschema/cursor_by_account.cc2
-rw-r--r--storage/perfschema/cursor_by_account.h2
-rw-r--r--storage/perfschema/cursor_by_host.cc2
-rw-r--r--storage/perfschema/cursor_by_host.h2
-rw-r--r--storage/perfschema/cursor_by_thread.cc2
-rw-r--r--storage/perfschema/cursor_by_thread.h2
-rw-r--r--storage/perfschema/cursor_by_user.cc2
-rw-r--r--storage/perfschema/cursor_by_user.h2
-rw-r--r--storage/perfschema/ha_perfschema.cc18
-rw-r--r--storage/perfschema/ha_perfschema.h37
-rw-r--r--storage/perfschema/pfs.cc179
-rw-r--r--storage/perfschema/pfs_account.cc91
-rw-r--r--storage/perfschema/pfs_account.h14
-rw-r--r--storage/perfschema/pfs_check.cc5
-rw-r--r--storage/perfschema/pfs_defaults.cc2
-rw-r--r--storage/perfschema/pfs_digest.cc111
-rw-r--r--storage/perfschema/pfs_digest.h8
-rw-r--r--storage/perfschema/pfs_engine_table.cc8
-rw-r--r--storage/perfschema/pfs_events_stages.cc20
-rw-r--r--storage/perfschema/pfs_events_statements.cc20
-rw-r--r--storage/perfschema/pfs_events_waits.cc20
-rw-r--r--storage/perfschema/pfs_global.cc4
-rw-r--r--storage/perfschema/pfs_global.h4
-rw-r--r--storage/perfschema/pfs_host.cc12
-rw-r--r--storage/perfschema/pfs_host.h5
-rw-r--r--storage/perfschema/pfs_instr.cc237
-rw-r--r--storage/perfschema/pfs_instr.h109
-rw-r--r--storage/perfschema/pfs_instr_class.cc8
-rw-r--r--storage/perfschema/pfs_instr_class.h17
-rw-r--r--storage/perfschema/pfs_server.h4
-rw-r--r--storage/perfschema/pfs_setup_object.cc4
-rw-r--r--storage/perfschema/pfs_stat.h7
-rw-r--r--storage/perfschema/pfs_user.cc4
-rw-r--r--storage/perfschema/pfs_user.h4
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.cc4
-rw-r--r--storage/perfschema/table_esgs_by_account_by_event_name.h4
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.cc4
-rw-r--r--storage/perfschema/table_esgs_by_host_by_event_name.h4
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.cc4
-rw-r--r--storage/perfschema/table_esgs_by_user_by_event_name.h4
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.cc7
-rw-r--r--storage/perfschema/table_esms_by_account_by_event_name.h4
-rw-r--r--storage/perfschema/table_esms_by_digest.cc4
-rw-r--r--storage/perfschema/table_esms_by_digest.h4
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.cc7
-rw-r--r--storage/perfschema/table_esms_by_host_by_event_name.h4
-rw-r--r--storage/perfschema/table_esms_by_thread_by_event_name.cc5
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.cc7
-rw-r--r--storage/perfschema/table_esms_by_user_by_event_name.h4
-rw-r--r--storage/perfschema/table_esms_global_by_event_name.cc7
-rw-r--r--storage/perfschema/table_events_statements.cc93
-rw-r--r--storage/perfschema/table_events_statements.h13
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.cc4
-rw-r--r--storage/perfschema/table_ews_by_account_by_event_name.h4
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.cc4
-rw-r--r--storage/perfschema/table_ews_by_host_by_event_name.h4
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.cc4
-rw-r--r--storage/perfschema/table_ews_by_user_by_event_name.h4
-rw-r--r--storage/perfschema/table_helper.cc23
-rw-r--r--storage/perfschema/table_helper.h8
-rw-r--r--storage/perfschema/table_host_cache.cc2
-rw-r--r--storage/perfschema/table_host_cache.h2
-rw-r--r--storage/perfschema/table_os_global_by_type.cc4
-rw-r--r--storage/perfschema/table_os_global_by_type.h2
-rw-r--r--storage/perfschema/table_session_connect.cc70
-rw-r--r--storage/perfschema/table_session_connect.h9
-rw-r--r--storage/perfschema/table_setup_actors.cc2
-rw-r--r--storage/perfschema/table_threads.cc85
-rw-r--r--storage/perfschema/table_tiws_by_table.cc4
-rw-r--r--storage/perfschema/table_tiws_by_table.h4
-rw-r--r--storage/perfschema/table_tlws_by_table.cc4
-rw-r--r--storage/perfschema/table_tlws_by_table.h4
-rw-r--r--storage/perfschema/unittest/CMakeLists.txt6
-rw-r--r--storage/perfschema/unittest/pfs_account-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/pfs_host-oom-t.cc2
-rw-r--r--storage/perfschema/unittest/stub_pfs_defaults.h2
-rw-r--r--storage/perfschema/unittest/stub_server_misc.h4
208 files changed, 3023 insertions, 1135 deletions
diff --git a/include/mysql/psi/mysql_file.h b/include/mysql/psi/mysql_file.h
index c226258f462..c839b2b019b 100644
--- a/include/mysql/psi/mysql_file.h
+++ b/include/mysql/psi/mysql_file.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2012, 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
diff --git a/include/mysql/psi/mysql_idle.h b/include/mysql/psi/mysql_idle.h
index c53d0ceb8c7..5c72b715b7a 100644
--- a/include/mysql/psi/mysql_idle.h
+++ b/include/mysql/psi/mysql_idle.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2012, 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
diff --git a/include/mysql/psi/mysql_stage.h b/include/mysql/psi/mysql_stage.h
index 61bfdbb7d59..91a5c12f82e 100644
--- a/include/mysql/psi/mysql_stage.h
+++ b/include/mysql/psi/mysql_stage.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
diff --git a/include/mysql/psi/mysql_thread.h b/include/mysql/psi/mysql_thread.h
index 604b9c5af61..99fcd348e87 100644
--- a/include/mysql/psi/mysql_thread.h
+++ b/include/mysql/psi/mysql_thread.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1167,7 +1167,7 @@ static inline int inline_mysql_cond_wait(
static inline int inline_mysql_cond_timedwait(
mysql_cond_t *that,
mysql_mutex_t *mutex,
- struct timespec *abstime
+ const struct timespec *abstime
#ifdef HAVE_PSI_COND_INTERFACE
, const char *src_file, uint src_line
#endif
diff --git a/include/mysql/psi/psi.h b/include/mysql/psi/psi.h
index cc2057c630d..30f2709be0f 100644
--- a/include/mysql/psi/psi.h
+++ b/include/mysql/psi/psi.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1372,7 +1372,7 @@ typedef void (*set_thread_state_v1_t)(const char* state);
@param info the process into string
@param info_len the process into string length
*/
-typedef void (*set_thread_info_v1_t)(const char* info, int info_len);
+typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
/**
Attach a thread instrumentation to the running thread.
diff --git a/include/mysql/psi/psi_abi_v1.h.pp b/include/mysql/psi/psi_abi_v1.h.pp
index f2037c5b724..fa2bf724b5e 100644
--- a/include/mysql/psi/psi_abi_v1.h.pp
+++ b/include/mysql/psi/psi_abi_v1.h.pp
@@ -357,7 +357,7 @@ typedef void (*set_thread_db_v1_t)(const char* db, int db_len);
typedef void (*set_thread_command_v1_t)(int command);
typedef void (*set_thread_start_time_v1_t)(time_t start_time);
typedef void (*set_thread_state_v1_t)(const char* state);
-typedef void (*set_thread_info_v1_t)(const char* info, int info_len);
+typedef void (*set_thread_info_v1_t)(const char* info, uint info_len);
typedef void (*set_thread_v1_t)(struct PSI_thread *thread);
typedef void (*delete_current_thread_v1_t)(void);
typedef void (*delete_thread_v1_t)(struct PSI_thread *thread);
diff --git a/mysql-test/suite/perfschema/include/disable_instruments.inc b/mysql-test/suite/perfschema/include/disable_instruments.inc
new file mode 100644
index 00000000000..b0a4ddec450
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/disable_instruments.inc
@@ -0,0 +1,23 @@
+# Tests for the performance schema
+
+# ==========================================
+# HELPER include/disable_instruments
+# ==========================================
+#
+# ==== Usage ====
+#
+# 1. Define the instrument to be disabled/enabled:
+#
+# let $pfs_instrument=<instrument>
+#
+# Where <instrument> is the instrument name with or without wildcards, e.g.
+#
+# let $pfs_instrument='%statement/sql%'
+#
+--disable_query_log ONCE
+
+eval update performance_schema.setup_instruments
+ set enabled='no', timed='no'
+ where name like $pfs_instrument;
+
+
diff --git a/mysql-test/suite/perfschema/include/enable_instruments.inc b/mysql-test/suite/perfschema/include/enable_instruments.inc
new file mode 100644
index 00000000000..94d63aee941
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/enable_instruments.inc
@@ -0,0 +1,23 @@
+# Tests for the performance schema
+
+# ==========================================
+# HELPER include/enable_instruments
+# ==========================================
+#
+# ==== Usage ====
+#
+# 1. Define the instrument to be enabled/disabled:
+#
+# let $pfs_instrument=<instrument>
+#
+# Where <instrument> is the instrument name with or without wildcards, e.g.
+#
+# let $pfs_instrument='%statement/sql%'
+#
+--disable_query_log ONCE
+
+eval update performance_schema.setup_instruments
+ set enabled='yes', timed='yes'
+ where name like $pfs_instrument;
+
+
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
index a0103649c09..769ba5f8607 100644
--- a/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
+++ b/mysql-test/suite/perfschema/include/event_aggregate_setup.inc
@@ -123,8 +123,8 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES'
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/abstract/new_packet',
+ 'statement/abstract/Query',
'statement/com/Quit',
'statement/com/error');
diff --git a/mysql-test/suite/perfschema/include/rpl_statements_truncate.inc b/mysql-test/suite/perfschema/include/rpl_statements_truncate.inc
new file mode 100644
index 00000000000..afd1d31a157
--- /dev/null
+++ b/mysql-test/suite/perfschema/include/rpl_statements_truncate.inc
@@ -0,0 +1,15 @@
+# Tests for the performance schema
+
+# ==========================================
+# HELPER include/rpl_truncate_statements.inc
+# ==========================================
+
+--disable_query_log
+update performance_schema.setup_instruments set enabled='no', timed='no' where name like '%statement/%';
+truncate table performance_schema.events_waits_history_long;
+truncate table performance_schema.events_statements_summary_by_digest;
+truncate table performance_schema.events_statements_history;
+truncate table performance_schema.events_statements_history_long;
+update performance_schema.setup_instruments set enabled='yes', timed='yes' where name like '%statement/%';
+--enable_query_log
+
diff --git a/mysql-test/suite/perfschema/include/sizing_auto.inc b/mysql-test/suite/perfschema/include/sizing_auto.inc
index 1a9afeaf219..4c3451ce8b5 100644
--- a/mysql-test/suite/perfschema/include/sizing_auto.inc
+++ b/mysql-test/suite/perfschema/include/sizing_auto.inc
@@ -2,8 +2,8 @@
show variables like "table_definition_cache";
show variables like "table_open_cache";
show variables like "max_connections";
-# Results vary by platform:
-# show variables like "open_files_limit";
+# open_files_limit depends on OS configuration (ulimit -n)
+#show variables like "open_files_limit";
show variables like "%performance_schema%";
show status like "%performance_schema%";
diff --git a/mysql-test/suite/perfschema/r/binlog_edge_row.result b/mysql-test/suite/perfschema/r/binlog_edge_row.result
index 9160519921a..40595a804f7 100644
--- a/mysql-test/suite/perfschema/r/binlog_edge_row.result
+++ b/mysql-test/suite/perfschema/r/binlog_edge_row.result
@@ -78,6 +78,8 @@ performance_schema.setup_instruments.timed= 'NO';
update my_bh_table, performance_schema.setup_instruments
set my_bh_table.a = my_bh_table.a + 1,
performance_schema.setup_instruments.timed= 'NO';
+Warnings:
+Warning 1870 Row events are not logged for UPDATE statements that modify BLACKHOLE tables in row format. Table(s): 'my_bh_table.'
use test;
drop table if exists marker_multi_delete;
Warnings:
@@ -101,6 +103,8 @@ delete my_bh_table.*, performance_schema.setup_actors.*
from my_bh_table, performance_schema.setup_actors
where my_bh_table.a != 1000
or performance_schema.setup_actors.role='BAZ';
+Warnings:
+Warning 1870 Row events are not logged for DELETE statements that modify BLACKHOLE tables in row format. Table(s): 'my_bh_table.'
use test;
drop table if exists marker_end;
Warnings:
diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
index 2df89cd0823..b3de51ee007 100644
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result
@@ -19,6 +19,9 @@ where name like 'Wait/Synch/Rwlock/sql/%'
and name not in ('wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock')
order by name limit 10;
NAME ENABLED TIMED
+wait/synch/rwlock/sql/Binlog_relay_IO_delegate::lock YES YES
+wait/synch/rwlock/sql/Binlog_storage_delegate::lock YES YES
+wait/synch/rwlock/sql/Binlog_transmit_delegate::lock YES YES
wait/synch/rwlock/sql/gtid_commit_rollback YES YES
wait/synch/rwlock/sql/LOCK_dboptions YES YES
wait/synch/rwlock/sql/LOCK_grant YES YES
@@ -26,9 +29,6 @@ wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES
wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES
wait/synch/rwlock/sql/LOCK_sys_init_slave YES YES
wait/synch/rwlock/sql/LOGGER::LOCK_logger YES YES
-wait/synch/rwlock/sql/MDL_context::LOCK_waiting_for YES YES
-wait/synch/rwlock/sql/MDL_lock::rwlock YES YES
-wait/synch/rwlock/sql/Query_cache_query::lock YES YES
select * from performance_schema.setup_instruments
where name like 'Wait/Synch/Cond/sql/%'
and name not in (
diff --git a/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-test/suite/perfschema/r/func_file_io.result
index a71c8e601aa..d710774a1f4 100644
--- a/mysql-test/suite/perfschema/r/func_file_io.result
+++ b/mysql-test/suite/perfschema/r/func_file_io.result
@@ -3,6 +3,7 @@ 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();
+truncate table performance_schema.events_statements_summary_by_digest;
flush status;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
diff --git a/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-test/suite/perfschema/r/func_mutex.result
index fa4c585e972..60f531f42f7 100644
--- a/mysql-test/suite/perfschema/r/func_mutex.result
+++ b/mysql-test/suite/perfschema/r/func_mutex.result
@@ -2,6 +2,7 @@ UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.setup_instruments SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
+truncate table performance_schema.events_statements_summary_by_digest;
flush status;
select NAME from performance_schema.mutex_instances
where NAME = 'wait/synch/mutex/sql/LOCK_open';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
index e77c2dcde6f..e0342e7acdd 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
@@ -23,8 +23,10 @@ User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
select @@global.max_connect_errors into @saved_max_connect_errors;
-set global max_connect_errors = 2;
+set global max_connect_errors = 3;
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+create user 'quota'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
select "Con1 is alive";
Con1 is alive
Con1 is alive
@@ -32,7 +34,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -61,7 +63,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -90,7 +92,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -178,7 +180,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -207,7 +209,215 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+ERROR 08S01: Bad handshake
+"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
+set global debug= "-d,native_password_bad_reply";
+message
+Valid connection should reset SUM_CONNECT_ERROR counter
+set global debug= "+d,native_password_bad_reply";
+"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 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 08S01: Bad handshake
+"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 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 08S01: Bad handshake
+"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 4
+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 08S01: Bad handshake
+"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 5
+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 5
+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 5
+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';
+revoke select on test.* from 'quota'@'santa.claus.ipv4.example.com';
+drop user 'quota'@'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_ipv6_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
index fa0142dad96..6fbf4108422 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
@@ -23,8 +23,10 @@ User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
select @@global.max_connect_errors into @saved_max_connect_errors;
-set global max_connect_errors = 2;
+set global max_connect_errors = 3;
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+create user 'quota'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
select "Con1 is alive";
Con1 is alive
Con1 is alive
@@ -32,7 +34,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -61,7 +63,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -90,7 +92,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -178,7 +180,7 @@ 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)
+ERROR 08S01: Bad handshake
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -207,7 +209,215 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+ERROR 08S01: Bad handshake
+"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
+set global debug= "-d,native_password_bad_reply";
+message
+Valid connection should reset SUM_CONNECT_ERROR counter
+set global debug= "+d,native_password_bad_reply";
+"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 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 08S01: Bad handshake
+"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 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 08S01: Bad handshake
+"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 4
+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 08S01: Bad handshake
+"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 5
+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 5
+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 5
+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';
+revoke select on test.* from 'quota'@'santa.claus.ipv6.example.com';
+drop user 'quota'@'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/innodb_table_io.result b/mysql-test/suite/perfschema/r/innodb_table_io.result
index 9b5bd783f88..460518aeb65 100644
--- a/mysql-test/suite/perfschema/r/innodb_table_io.result
+++ b/mysql-test/suite/perfschema/r/innodb_table_io.result
@@ -106,9 +106,6 @@ 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
diff --git a/mysql-test/suite/perfschema/r/myisam_file_io.result b/mysql-test/suite/perfschema/r/myisam_file_io.result
index 40a282d9a60..f7bb9238311 100644
--- a/mysql-test/suite/perfschema/r/myisam_file_io.result
+++ b/mysql-test/suite/perfschema/r/myisam_file_io.result
@@ -4,6 +4,7 @@ update performance_schema.setup_instruments set enabled='YES'
update performance_schema.setup_consumers
set enabled='YES';
truncate table performance_schema.events_waits_history_long;
+truncate table performance_schema.events_statements_summary_by_digest;
flush status;
drop table if exists test.no_index_tab;
create table test.no_index_tab ( a varchar(255), b int ) engine=myisam;
diff --git a/mysql-test/suite/perfschema/r/ortho_iter.result b/mysql-test/suite/perfschema/r/ortho_iter.result
index 829382e68e7..e8fd6fcc19b 100644
--- a/mysql-test/suite/perfschema/r/ortho_iter.result
+++ b/mysql-test/suite/perfschema/r/ortho_iter.result
@@ -28,7 +28,8 @@ 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, "%"))
+where (name like (concat(instr_name, "%")))
+and (not name like "%/abstract/%")
into count_expected;
set cmd_1= "select count(*) from (select distinct event_name from performance_schema.";
set cmd_2= concat(" where event_name like \"",
@@ -110,12 +111,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
@@ -639,6 +640,41 @@ status
Checking table events_waits_summary_global_by_event_name ...
Warnings:
Warning 12000 Done
+call check_instrument("statement/abstract/");
+instr_name is_wait is_stage is_statement
+statement/abstract/ 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
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
index f92abce1c84..65c76d8decc 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
@@ -6,59 +6,59 @@ update mysql.event set db='performance_schema' where name='user_event';
Warning: Using a password on the command line interface can be insecure.
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 156: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 181: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 206: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 231: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 244: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 257: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 270: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 284: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 297: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 309: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 347: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 378: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 421: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 450: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 485: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 494: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 508: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 518: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 528: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 537: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 545: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 554: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 565: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 573: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 618: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 662: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 741: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 761: Table 'threads' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 793: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 809: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 822: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 835: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 848: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 862: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 874: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 920: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 966: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 1012: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1076: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1108: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1141: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1181: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1190: Table 'users' already exists
-ERROR 1050 (42S01) at line 1200: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1235: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line 1245: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line 1251: Table 'session_account_connect_attrs' already exists
-ERROR 1644 (HY000) at line 1844: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 164: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 189: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 252: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 265: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 278: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 292: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 305: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 317: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 326: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 355: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 386: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 399: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 429: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 458: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 493: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 502: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 516: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 526: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 536: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 545: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 553: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 562: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 573: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 581: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 626: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 670: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 749: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 769: Table 'threads' already exists
+ERROR 1050 (42S01) at line 785: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 801: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 830: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 843: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 856: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 870: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 882: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 928: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1149: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1180: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1189: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1198: Table 'users' already exists
+ERROR 1050 (42S01) at line 1208: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1243: Table 'events_statements_summary_by_digest' already exists
+ERROR 1050 (42S01) at line 1253: Table 'session_connect_attrs' already exists
+ERROR 1050 (42S01) at line 1259: Table 'session_account_connect_attrs' already exists
+ERROR 1644 (HY000) at line 1852: 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/pfs_upgrade_func.result b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
index 5162fa7466e..3bd4ddd9505 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
@@ -6,59 +6,59 @@ update mysql.proc set db='performance_schema' where name='user_func';
Warning: Using a password on the command line interface can be insecure.
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 156: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 181: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 206: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 231: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 244: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 257: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 270: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 284: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 297: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 309: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 347: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 378: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 421: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 450: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 485: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 494: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 508: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 518: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 528: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 537: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 545: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 554: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 565: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 573: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 618: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 662: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 741: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 761: Table 'threads' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 793: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 809: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 822: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 835: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 848: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 862: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 874: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 920: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 966: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 1012: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1076: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1108: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1141: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1181: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1190: Table 'users' already exists
-ERROR 1050 (42S01) at line 1200: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1235: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line 1245: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line 1251: Table 'session_account_connect_attrs' already exists
-ERROR 1644 (HY000) at line 1844: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 164: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 189: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 252: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 265: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 278: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 292: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 305: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 317: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 326: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 355: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 386: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 399: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 429: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 458: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 493: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 502: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 516: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 526: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 536: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 545: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 553: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 562: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 573: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 581: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 626: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 670: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 749: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 769: Table 'threads' already exists
+ERROR 1050 (42S01) at line 785: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 801: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 830: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 843: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 856: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 870: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 882: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 928: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1149: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1180: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1189: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1198: Table 'users' already exists
+ERROR 1050 (42S01) at line 1208: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1243: Table 'events_statements_summary_by_digest' already exists
+ERROR 1050 (42S01) at line 1253: Table 'session_connect_attrs' already exists
+ERROR 1050 (42S01) at line 1259: Table 'session_account_connect_attrs' already exists
+ERROR 1644 (HY000) at line 1852: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
index aa13f5cf227..574061d9b9d 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
@@ -6,59 +6,59 @@ update mysql.proc set db='performance_schema' where name='user_proc';
Warning: Using a password on the command line interface can be insecure.
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 156: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 181: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 206: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 231: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 244: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 257: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 270: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 284: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 297: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 309: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 347: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 378: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 421: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 450: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 485: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 494: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 508: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 518: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 528: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 537: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 545: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 554: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 565: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 573: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 618: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 662: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 741: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 761: Table 'threads' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 793: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 809: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 822: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 835: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 848: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 862: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 874: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 920: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 966: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 1012: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1076: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1108: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1141: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1181: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1190: Table 'users' already exists
-ERROR 1050 (42S01) at line 1200: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1235: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line 1245: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line 1251: Table 'session_account_connect_attrs' already exists
-ERROR 1644 (HY000) at line 1844: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 164: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 189: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 252: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 265: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 278: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 292: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 305: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 317: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 326: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 355: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 386: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 399: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 429: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 458: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 493: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 502: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 516: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 526: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 536: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 545: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 553: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 562: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 573: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 581: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 626: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 670: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 749: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 769: Table 'threads' already exists
+ERROR 1050 (42S01) at line 785: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 801: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 830: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 843: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 856: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 870: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 882: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 928: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1149: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1180: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1189: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1198: Table 'users' already exists
+ERROR 1050 (42S01) at line 1208: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1243: Table 'events_statements_summary_by_digest' already exists
+ERROR 1050 (42S01) at line 1253: Table 'session_connect_attrs' already exists
+ERROR 1050 (42S01) at line 1259: Table 'session_account_connect_attrs' already exists
+ERROR 1644 (HY000) at line 1852: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
select name from mysql.proc where db='performance_schema';
name
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
index 74329c79db6..79471353063 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
@@ -8,59 +8,59 @@ user_table
Warning: Using a password on the command line interface can be insecure.
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 156: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 181: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 206: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 231: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 244: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 257: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 270: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 284: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 297: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 309: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 347: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 378: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 421: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 450: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 485: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 494: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 508: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 518: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 528: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 537: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 545: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 554: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 565: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 573: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 618: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 662: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 741: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 761: Table 'threads' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 793: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 809: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 822: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 835: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 848: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 862: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 874: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 920: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 966: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 1012: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1076: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1108: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1141: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1181: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1190: Table 'users' already exists
-ERROR 1050 (42S01) at line 1200: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1235: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line 1245: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line 1251: Table 'session_account_connect_attrs' already exists
-ERROR 1644 (HY000) at line 1844: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 164: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 189: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 252: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 265: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 278: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 292: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 305: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 317: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 326: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 355: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 386: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 399: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 429: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 458: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 493: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 502: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 516: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 526: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 536: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 545: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 553: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 562: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 573: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 581: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 626: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 670: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 749: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 769: Table 'threads' already exists
+ERROR 1050 (42S01) at line 785: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 801: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 830: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 843: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 856: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 870: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 882: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 928: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1149: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1180: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1189: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1198: Table 'users' already exists
+ERROR 1050 (42S01) at line 1208: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1243: Table 'events_statements_summary_by_digest' already exists
+ERROR 1050 (42S01) at line 1253: Table 'session_connect_attrs' already exists
+ERROR 1050 (42S01) at line 1259: Table 'session_account_connect_attrs' already exists
+ERROR 1644 (HY000) at line 1852: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
show tables like "user_table";
Tables_in_performance_schema (user_table)
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
index ddc9579a513..90d44087bb0 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
@@ -8,59 +8,59 @@ user_view
Warning: Using a password on the command line interface can be insecure.
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 156: Table 'cond_instances' already exists
-ERROR 1050 (42S01) at line 181: Table 'events_waits_current' already exists
-ERROR 1050 (42S01) at line 206: Table 'events_waits_history' already exists
-ERROR 1050 (42S01) at line 231: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 244: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 257: Table 'events_waits_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 270: Table 'events_waits_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 284: Table 'events_waits_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 297: Table 'events_waits_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 309: Table 'events_waits_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 318: Table 'file_instances' already exists
-ERROR 1050 (42S01) at line 347: Table 'file_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 378: Table 'file_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 391: Table 'socket_instances' already exists
-ERROR 1050 (42S01) at line 421: Table 'socket_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 450: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 485: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 494: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 508: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 518: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 528: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 537: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 545: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 554: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 565: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 573: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 618: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 662: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 741: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 761: Table 'threads' already exists
-ERROR 1050 (42S01) at line 777: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 793: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 809: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 822: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 835: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 848: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 862: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 874: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 920: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 966: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 1012: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 1044: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 1076: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1108: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1141: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1172: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1181: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1190: Table 'users' already exists
-ERROR 1050 (42S01) at line 1200: Table 'accounts' already exists
-ERROR 1050 (42S01) at line 1235: Table 'events_statements_summary_by_digest' already exists
-ERROR 1050 (42S01) at line 1245: Table 'session_connect_attrs' already exists
-ERROR 1050 (42S01) at line 1251: Table 'session_account_connect_attrs' already exists
-ERROR 1644 (HY000) at line 1844: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 164: Table 'cond_instances' already exists
+ERROR 1050 (42S01) at line 189: Table 'events_waits_current' already exists
+ERROR 1050 (42S01) at line 214: Table 'events_waits_history' already exists
+ERROR 1050 (42S01) at line 239: Table 'events_waits_history_long' already exists
+ERROR 1050 (42S01) at line 252: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 265: Table 'events_waits_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 278: Table 'events_waits_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 292: Table 'events_waits_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 305: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 317: Table 'events_waits_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 326: Table 'file_instances' already exists
+ERROR 1050 (42S01) at line 355: Table 'file_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 386: Table 'file_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 399: Table 'socket_instances' already exists
+ERROR 1050 (42S01) at line 429: Table 'socket_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 458: Table 'socket_summary_by_event_name' already exists
+ERROR 1050 (42S01) at line 493: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 502: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 516: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 526: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 536: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 545: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 553: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 562: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 573: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 581: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 626: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 670: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 749: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 769: Table 'threads' already exists
+ERROR 1050 (42S01) at line 785: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 801: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 817: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 830: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 843: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 856: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 870: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 882: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 928: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 974: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 1020: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 1052: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1084: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1116: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1149: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1180: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1189: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1198: Table 'users' already exists
+ERROR 1050 (42S01) at line 1208: Table 'accounts' already exists
+ERROR 1050 (42S01) at line 1243: Table 'events_statements_summary_by_digest' already exists
+ERROR 1050 (42S01) at line 1253: Table 'session_connect_attrs' already exists
+ERROR 1050 (42S01) at line 1259: Table 'session_account_connect_attrs' already exists
+ERROR 1644 (HY000) at line 1852: Unexpected content found in the performance_schema database.
FATAL ERROR: Upgrade failed
show tables like "user_view";
Tables_in_performance_schema (user_view)
diff --git a/mysql-test/suite/perfschema/r/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result
index 0bb7f03602a..ffba8643d79 100644
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result
@@ -41,12 +41,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index 59829db89dc..2b11019799b 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -1,7 +1,7 @@
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
-Note #### 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.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
drop table if exists test.t1;
reset master;
@@ -69,6 +69,7 @@ wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_log MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_sync MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_sync_queue MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xids NONE
"Expect no slave relay log"
select * from performance_schema.file_summary_by_instance
where event_name like "%relaylog%" order by file_name;
@@ -93,6 +94,7 @@ wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_log 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_sync 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_sync_queue 0 0 0 0 0
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_xids 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;
@@ -159,6 +161,7 @@ wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_log MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_sync MANY
wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_sync_queue MANY
+wait/synch/mutex/sql/MYSQL_BIN_LOG::LOCK_xids NONE
"Expect a slave relay log"
select
substring(file_name, locate("slave-", file_name)) as FILE_NAME,
@@ -203,6 +206,7 @@ wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_done NONE
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_flush_queue NONE
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index MANY
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_log MANY
-wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_sync MANY
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_sync NONE
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_sync_queue NONE
+wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_xids MANY
include/rpl_end.inc
diff --git a/mysql-test/suite/perfschema/r/rpl_gtid_func.result b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
index 4714b63c440..c7727791eb7 100644
--- a/mysql-test/suite/perfschema/r/rpl_gtid_func.result
+++ b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
@@ -1,7 +1,7 @@
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
-Note #### 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.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
**** On Master ****
drop table if exists test.marker;
diff --git a/mysql-test/suite/perfschema/r/rpl_statements.result b/mysql-test/suite/perfschema/r/rpl_statements.result
new file mode 100644
index 00000000000..dd8d349b989
--- /dev/null
+++ b/mysql-test/suite/perfschema/r/rpl_statements.result
@@ -0,0 +1,244 @@
+include/master-slave.inc
+Warnings:
+Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
+Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
+[connection master]
+
+#
+# STEP 1 - CREATE AND REPLICATE TEST TABLES
+#
+
+**************
+*** MASTER ***
+**************
+
+*** Create test tables
+
+show variables like '%binlog_format%';
+Variable_name Value
+binlog_format MIXED
+drop table if exists test.marker;
+select thread_id into @my_thread_id
+from performance_schema.threads
+where processlist_id = connection_id();
+create table test.marker(s1 int) engine=innodb;
+**************
+*** SLAVE ***
+**************
+
+*** Clear statement events
+
+#
+# STEP 2 - REPLICATE ONE ROW ON MASTER TO GET REPLICATION THREAD ID ON SLAVE
+#
+**************
+*** MASTER ***
+**************
+
+insert into test.marker values (0);
+
+**************
+*** SLAVE ***
+**************
+
+*** Verify row, get replication thread id, clear statement events
+
+select thread_id into @slave_thread_id from performance_schema.events_statements_history
+where sql_text like '%marker%';
+*** Verify row inserted on master was replicated
+select count(*) = 1 as 'Expect 1' from test.marker;
+Expect 1
+1
+*** Clear statement events
+
+#
+# STEP 3 - PERFORM DML STATEMENTS ON MASTER
+#
+**************
+*** MASTER ***
+**************
+
+show variables like '%binlog_format%';
+Variable_name Value
+binlog_format MIXED
+*** Clear statement events
+
+*** Create/drop table, create/drop database
+
+create database marker1_db;
+create database marker2_db;
+create table marker1_db.table1 (s1 int) engine=innodb;
+create table marker2_db.table1 (s1 int) engine=innodb;
+create table marker2_db.table2 (s1 int) engine=innodb;
+
+*** Transaction
+start transaction;
+insert into marker1_db.table1 values (1), (2), (3);
+insert into marker2_db.table1 values (1), (2), (3);
+commit;
+
+*** Alter
+alter table marker1_db.table1 add column (s2 varchar(32));
+
+*** Insert, Update
+start transaction;
+insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six');
+update marker1_db.table1 set s1 = s1 + 1;
+commit;
+
+*** Rollback
+start transaction;
+insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine');
+rollback;
+
+*** Autocommit, Delete, Drop
+delete from marker1_db.table1 where s1 > 4;
+drop table marker2_db.table1;
+drop database marker2_db;
+
+*** Examine statements events that will be compared on the slave
+
+select thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text from performance_schema.events_statements_history_long
+where sql_text like '%marker%' order by event_id;
+thread_id event_id event_name current_schema digest_text sql_text
+[THREAD_ID] [EVENT_ID] statement/sql/create_db test CREATE SCHEMA marker1_db create database marker1_db
+[THREAD_ID] [EVENT_ID] statement/sql/create_db test CREATE SCHEMA marker2_db create database marker2_db
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker1_db . table1 ( s1 INTEGER ) ENGINE = innodb create table marker1_db.table1 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker2_db . table1 ( s1 INTEGER ) ENGINE = innodb create table marker2_db.table1 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker2_db . table2 ( s1 INTEGER ) ENGINE = innodb create table marker2_db.table2 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (?) /* , ... */ insert into marker1_db.table1 values (1), (2), (3)
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker2_db . table1 VALUES (?) /* , ... */ insert into marker2_db.table1 values (1), (2), (3)
+[THREAD_ID] [EVENT_ID] statement/sql/alter_table test ALTER TABLE marker1_db . table1 ADD COLUMN ( s2 VARCHARACTER (?) ) alter table marker1_db.table1 add column (s2 varchar(32))
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (...) /* , ... */ insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
+[THREAD_ID] [EVENT_ID] statement/sql/update test UPDATE marker1_db . table1 SET s1 = s1 + ? update marker1_db.table1 set s1 = s1 + 1
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (...) /* , ... */ insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine')
+[THREAD_ID] [EVENT_ID] statement/sql/delete test DELETE FROM marker1_db . table1 WHERE s1 > ? delete from marker1_db.table1 where s1 > 4
+[THREAD_ID] [EVENT_ID] statement/sql/drop_table test DROP TABLE marker2_db . table1 drop table marker2_db.table1
+[THREAD_ID] [EVENT_ID] statement/sql/drop_db test DROP SCHEMA marker2_db drop database marker2_db
+
+#
+# STEP 4 - REPLICATE STATEMENT EVENTS ON MASTER TO SLAVE
+#
+
+*** Store statement events in holding table, then replicate
+
+#
+# Create table to hold statement events for later comparison on the slave
+#
+create table test.master_events_statements_history_long as
+(select thread_id, event_id, event_name, sql_text, digest, digest_text, current_schema, rows_affected
+from performance_schema.events_statements_history_long
+where (thread_id=@my_thread_id and digest_text like '%marker%'));
+
+#
+# STEP 5 - VERIFY DML AND DDL STATEMENT EVENTS ON SLAVE
+#
+**************
+*** SLAVE ***
+**************
+
+*** List statement events from master
+
+select thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text from master_events_statements_history_long order by event_id;
+thread_id event_id event_name current_schema digest_text sql_text
+[THREAD_ID] [EVENT_ID] statement/sql/create_db test CREATE SCHEMA marker1_db create database marker1_db
+[THREAD_ID] [EVENT_ID] statement/sql/create_db test CREATE SCHEMA marker2_db create database marker2_db
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker1_db . table1 ( s1 INTEGER ) ENGINE = innodb create table marker1_db.table1 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker2_db . table1 ( s1 INTEGER ) ENGINE = innodb create table marker2_db.table1 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker2_db . table2 ( s1 INTEGER ) ENGINE = innodb create table marker2_db.table2 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (?) /* , ... */ insert into marker1_db.table1 values (1), (2), (3)
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker2_db . table1 VALUES (?) /* , ... */ insert into marker2_db.table1 values (1), (2), (3)
+[THREAD_ID] [EVENT_ID] statement/sql/alter_table test ALTER TABLE marker1_db . table1 ADD COLUMN ( s2 VARCHARACTER (?) ) alter table marker1_db.table1 add column (s2 varchar(32))
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (...) /* , ... */ insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
+[THREAD_ID] [EVENT_ID] statement/sql/update test UPDATE marker1_db . table1 SET s1 = s1 + ? update marker1_db.table1 set s1 = s1 + 1
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (...) /* , ... */ insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine')
+[THREAD_ID] [EVENT_ID] statement/sql/delete test DELETE FROM marker1_db . table1 WHERE s1 > ? delete from marker1_db.table1 where s1 > 4
+[THREAD_ID] [EVENT_ID] statement/sql/drop_table test DROP TABLE marker2_db . table1 drop table marker2_db.table1
+[THREAD_ID] [EVENT_ID] statement/sql/drop_db test DROP SCHEMA marker2_db drop database marker2_db
+
+*** List statement events on slave
+
+select thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text from performance_schema.events_statements_history_long
+where thread_id = @slave_thread_id and sql_text like '%marker%' order by event_id;
+thread_id event_id event_name current_schema digest_text sql_text
+[THREAD_ID] [EVENT_ID] statement/sql/create_db marker1_db CREATE SCHEMA marker1_db create database marker1_db
+[THREAD_ID] [EVENT_ID] statement/sql/create_db marker2_db CREATE SCHEMA marker2_db create database marker2_db
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker1_db . table1 ( s1 INTEGER ) ENGINE = innodb create table marker1_db.table1 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker2_db . table1 ( s1 INTEGER ) ENGINE = innodb create table marker2_db.table1 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/create_table test CREATE TABLE marker2_db . table2 ( s1 INTEGER ) ENGINE = innodb create table marker2_db.table2 (s1 int) engine=innodb
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (?) /* , ... */ insert into marker1_db.table1 values (1), (2), (3)
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker2_db . table1 VALUES (?) /* , ... */ insert into marker2_db.table1 values (1), (2), (3)
+[THREAD_ID] [EVENT_ID] statement/sql/alter_table test ALTER TABLE marker1_db . table1 ADD COLUMN ( s2 VARCHARACTER (?) ) alter table marker1_db.table1 add column (s2 varchar(32))
+[THREAD_ID] [EVENT_ID] statement/sql/insert test INSERT INTO marker1_db . table1 VALUES (...) /* , ... */ insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six')
+[THREAD_ID] [EVENT_ID] statement/sql/update test UPDATE marker1_db . table1 SET s1 = s1 + ? update marker1_db.table1 set s1 = s1 + 1
+[THREAD_ID] [EVENT_ID] statement/sql/delete test DELETE FROM marker1_db . table1 WHERE s1 > ? delete from marker1_db.table1 where s1 > 4
+[THREAD_ID] [EVENT_ID] statement/sql/drop_table test DROP TABLE `marker2_db` . `table1` DROP TABLE `marker2_db`.`table1` /* generated by server */
+[THREAD_ID] [EVENT_ID] statement/sql/drop_db marker2_db DROP SCHEMA marker2_db drop database marker2_db
+
+*** Compare master and slave events
+
+
+*** Event name comparison - expect 0 mismatches
+
+select thread_id, event_id, event_name, digest_text, sql_text from performance_schema.events_statements_history_long t1
+where t1.thread_id = @slave_thread_id and
+sql_text like '%marker%' and
+not exists (select * from master_events_statements_history_long t2 where t2.event_name = t1.event_name);
+thread_id event_id event_name digest_text sql_text
+
+*** Statement digest comparison - expect 1 mismatch for DROP TABLE
+
+select thread_id, event_id, event_name, digest, digest_text, sql_text from performance_schema.events_statements_history_long t1
+where t1.thread_id = @slave_thread_id and
+sql_text like '%marker%' and
+not exists (select * from master_events_statements_history_long t2 where t2.digest = t1.digest);
+thread_id event_id event_name digest digest_text sql_text
+[THREAD_ID] [EVENT_ID] statement/sql/drop_table [DIGEST] DROP TABLE `marker2_db` . `table1` DROP TABLE `marker2_db`.`table1` /* generated by server */
+
+#
+# STEP 6 - DISABLE REPLICATED STATEMENT EVENTS ON SLAVE
+#
+update performance_schema.setup_instruments set enabled='no', timed='no'
+ where name like '%statement/abstract/relay_log%';
+select * from performance_schema.setup_instruments where name like '%statement/abstract/relay_log%';
+NAME ENABLED TIMED
+statement/abstract/relay_log NO NO
+
+#
+# STEP 7 - UPDATE TABLES ON MASTER, REPLICATE
+#
+**************
+*** MASTER ***
+**************
+
+*** Clear statement events
+*** Update some tables, then replicate
+
+insert into marker1_db.table1 values (999, '999'), (998, '998'), (997, '997');
+
+#
+# STEP 8 - VERIFY TABLE UPDATES FROM MASTER, EXPECT NO STATEMENT EVENTS ON SLAVE
+#
+**************
+*** SLAVE ***
+**************
+
+*** Confirm rows were replicated
+
+select * from marker1_db.table1 where s1 > 900 order by s1;
+s1 s2
+997 997
+998 998
+999 999
+
+*** Confirm that are no statements events from the replication thread
+
+select * from performance_schema.events_statements_history_long
+where thread_id = @slave_thread_id;
+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
+
+#
+# STEP 9 - CLEAN UP
+#
+
+include/rpl_end.inc
diff --git a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
index 531af43d798..6932d8926c9 100644
--- a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
+++ b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result
@@ -1,14 +1,19 @@
+#
+# Verify that the configuration file defaults were processed correctly
+#
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')
+'wait/synch/mutex/sql/LOCK_xid_cache',
+'stage/sql/creating table')
AND enabled = 'yes' AND timed = 'no'
ORDER BY name;
NAME ENABLED TIMED
+stage/sql/creating table YES NO
wait/synch/mutex/sql/LOCK_user_conn YES NO
wait/synch/mutex/sql/LOCK_uuid_generator YES NO
+wait/synch/mutex/sql/LOCK_xid_cache YES NO
SELECT * FROM performance_schema.setup_instruments
WHERE name = 'wait/synch/mutex/sql/LOCK_thread_count'
AND enabled = 'no' AND timed = 'no';
@@ -24,13 +29,36 @@ 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')
+WHERE name = '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
+#
+# Verify that the instrument startup settings are not not visible.
+#
SHOW VARIABLES LIKE "%/wait/synch/mutex%";
Variable_name Value
+#
+# Verify command line options are processed correctly
+#
+#
+# Verify that wait/io/table/sql/handler is enabled and timed
+#
+SELECT * FROM performance_schema.setup_instruments
+WHERE name like "%wait/io/table/sql/handler%";
+NAME ENABLED TIMED
+wait/io/table/sql/handler YES YES
+#
+# Stop server
+# Restart server with wait/io/table/sql/handler disabled
+# Enable reconnect
+# Wait until connected again
+# Disable reconnect
+#
+# Verify that wait/io/table is disabled
+#
+SELECT * FROM performance_schema.setup_instruments
+WHERE name like "%wait/io/table/sql/handler%";
+NAME ENABLED TIMED
+wait/io/table/sql/handler NO NO
diff --git a/mysql-test/suite/perfschema/r/sizing_default.result b/mysql-test/suite/perfschema/r/sizing_default.result
index 2a1a89dd4ba..ef7f7069c19 100644
--- a/mysql-test/suite/perfschema/r/sizing_default.result
+++ b/mysql-test/suite/perfschema/r/sizing_default.result
@@ -1,45 +1,45 @@
show variables like "table_definition_cache";
Variable_name Value
-table_definition_cache 400
+table_definition_cache 1400
show variables like "table_open_cache";
Variable_name Value
-table_open_cache 400
+table_open_cache 2000
show variables like "max_connections";
Variable_name Value
max_connections 151
show variables like "%performance_schema%";
Variable_name Value
performance_schema ON
-performance_schema_accounts_size 10
-performance_schema_digests_size 1000
-performance_schema_events_stages_history_long_size 100
-performance_schema_events_stages_history_size 5
-performance_schema_events_statements_history_long_size 100
-performance_schema_events_statements_history_size 5
-performance_schema_events_waits_history_long_size 100
-performance_schema_events_waits_history_size 5
-performance_schema_hosts_size 20
+performance_schema_accounts_size 100
+performance_schema_digests_size 10000
+performance_schema_events_stages_history_long_size 10000
+performance_schema_events_stages_history_size 10
+performance_schema_events_statements_history_long_size 10000
+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 836
+performance_schema_max_cond_instances 3504
performance_schema_max_file_classes 50
performance_schema_max_file_handles 32768
-performance_schema_max_file_instances 1556
+performance_schema_max_file_instances 7693
performance_schema_max_mutex_classes 200
-performance_schema_max_mutex_instances 3282
-performance_schema_max_rwlock_classes 30
-performance_schema_max_rwlock_instances 1724
+performance_schema_max_mutex_instances 15906
+performance_schema_max_rwlock_classes 40
+performance_schema_max_rwlock_instances 9102
performance_schema_max_socket_classes 10
-performance_schema_max_socket_instances 179
+performance_schema_max_socket_instances 322
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 167
-performance_schema_max_table_handles 445
-performance_schema_max_table_instances 445
+performance_schema_max_statement_classes 168
+performance_schema_max_table_handles 4000
+performance_schema_max_table_instances 12500
performance_schema_max_thread_classes 50
-performance_schema_max_thread_instances 224
+performance_schema_max_thread_instances 402
performance_schema_session_connect_attrs_size 512
performance_schema_setup_actors_size 100
performance_schema_setup_objects_size 100
-performance_schema_users_size 5
+performance_schema_users_size 100
show status like "%performance_schema%";
Variable_name Value
Performance_schema_accounts_lost 0
@@ -68,19 +68,19 @@ Performance_schema_users_lost 0
show engine performance_schema status;
Type Name Status
performance_schema events_waits_current.row_size 184
-performance_schema events_waits_current.row_count 1344
+performance_schema events_waits_current.row_count 2412
performance_schema events_waits_history.row_size 184
-performance_schema events_waits_history.row_count 1120
-performance_schema events_waits_history.memory 206080
+performance_schema events_waits_history.row_count 4020
+performance_schema events_waits_history.memory 739680
performance_schema events_waits_history_long.row_size 184
-performance_schema events_waits_history_long.row_count 100
-performance_schema events_waits_history_long.memory 18400
+performance_schema events_waits_history_long.row_count 10000
+performance_schema events_waits_history_long.memory 1840000
performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 30
-performance_schema (pfs_rwlock_class).memory 9600
+performance_schema (pfs_rwlock_class).row_count 40
+performance_schema (pfs_rwlock_class).memory 12800
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
@@ -91,32 +91,32 @@ performance_schema (pfs_file_class).row_size 320
performance_schema (pfs_file_class).row_count 50
performance_schema (pfs_file_class).memory 16000
performance_schema mutex_instances.row_size 128
-performance_schema mutex_instances.row_count 3282
-performance_schema mutex_instances.memory 420096
+performance_schema mutex_instances.row_count 15906
+performance_schema mutex_instances.memory 2035968
performance_schema rwlock_instances.row_size 192
-performance_schema rwlock_instances.row_count 1724
-performance_schema rwlock_instances.memory 331008
+performance_schema rwlock_instances.row_count 9102
+performance_schema rwlock_instances.memory 1747584
performance_schema cond_instances.row_size 128
-performance_schema cond_instances.row_count 836
-performance_schema cond_instances.memory 107008
-performance_schema threads.row_size 1856
-performance_schema threads.row_count 224
-performance_schema threads.memory 415744
+performance_schema cond_instances.row_count 3504
+performance_schema cond_instances.memory 448512
+performance_schema threads.row_size 2816
+performance_schema threads.row_count 402
+performance_schema threads.memory 1132032
performance_schema file_instances.row_size 704
-performance_schema file_instances.row_count 1556
-performance_schema file_instances.memory 1095424
+performance_schema file_instances.row_count 7693
+performance_schema file_instances.memory 5415872
performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 83552
-performance_schema events_waits_summary_by_thread_by_event_name.memory 2673664
+performance_schema events_waits_summary_by_thread_by_event_name.row_count 153966
+performance_schema events_waits_summary_by_thread_by_event_name.memory 4926912
performance_schema (pfs_table_share).row_size 22208
-performance_schema (pfs_table_share).row_count 445
-performance_schema (pfs_table_share).memory 9882560
+performance_schema (pfs_table_share).row_count 12500
+performance_schema (pfs_table_share).memory 277600000
performance_schema (pfs_table).row_size 9280
-performance_schema (pfs_table).row_count 445
-performance_schema (pfs_table).memory 4129600
+performance_schema (pfs_table).row_count 4000
+performance_schema (pfs_table).memory 37120000
performance_schema setup_actors.row_size 256
performance_schema setup_actors.row_count 100
performance_schema setup_actors.memory 25600
@@ -124,101 +124,101 @@ performance_schema setup_objects.row_size 448
performance_schema setup_objects.row_count 100
performance_schema setup_objects.memory 44800
performance_schema (pfs_account).row_size 256
-performance_schema (pfs_account).row_count 10
-performance_schema (pfs_account).memory 2560
+performance_schema (pfs_account).row_count 100
+performance_schema (pfs_account).memory 25600
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 3730
-performance_schema events_waits_summary_by_account_by_event_name.memory 119360
+performance_schema events_waits_summary_by_account_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_account_by_event_name.memory 1225600
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 1865
-performance_schema events_waits_summary_by_user_by_event_name.memory 59680
+performance_schema events_waits_summary_by_user_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_user_by_event_name.memory 1225600
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 7460
-performance_schema events_waits_summary_by_host_by_event_name.memory 238720
+performance_schema events_waits_summary_by_host_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_host_by_event_name.memory 1225600
performance_schema (pfs_user).row_size 128
-performance_schema (pfs_user).row_count 5
-performance_schema (pfs_user).memory 640
+performance_schema (pfs_user).row_count 100
+performance_schema (pfs_user).memory 12800
performance_schema (pfs_host).row_size 128
-performance_schema (pfs_host).row_count 20
-performance_schema (pfs_host).memory 2560
-performance_schema (pfs_stage_class).row_size 192
+performance_schema (pfs_host).row_count 100
+performance_schema (pfs_host).memory 12800
+performance_schema (pfs_stage_class).row_size 256
performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 28800
+performance_schema (pfs_stage_class).memory 38400
performance_schema events_stages_history.row_size 88
-performance_schema events_stages_history.row_count 1120
-performance_schema events_stages_history.memory 98560
+performance_schema events_stages_history.row_count 4020
+performance_schema events_stages_history.memory 353760
performance_schema events_stages_history_long.row_size 88
-performance_schema events_stages_history_long.row_count 100
-performance_schema events_stages_history_long.memory 8800
+performance_schema events_stages_history_long.row_count 10000
+performance_schema events_stages_history_long.memory 880000
performance_schema events_stages_summary_by_thread_by_event_name.row_size 32
-performance_schema events_stages_summary_by_thread_by_event_name.row_count 33600
-performance_schema events_stages_summary_by_thread_by_event_name.memory 1075200
+performance_schema events_stages_summary_by_thread_by_event_name.row_count 60300
+performance_schema events_stages_summary_by_thread_by_event_name.memory 1929600
performance_schema events_stages_summary_global_by_event_name.row_size 32
performance_schema events_stages_summary_global_by_event_name.row_count 150
performance_schema events_stages_summary_global_by_event_name.memory 4800
performance_schema events_stages_summary_by_account_by_event_name.row_size 32
-performance_schema events_stages_summary_by_account_by_event_name.row_count 1500
-performance_schema events_stages_summary_by_account_by_event_name.memory 48000
+performance_schema events_stages_summary_by_account_by_event_name.row_count 15000
+performance_schema events_stages_summary_by_account_by_event_name.memory 480000
performance_schema events_stages_summary_by_user_by_event_name.row_size 32
-performance_schema events_stages_summary_by_user_by_event_name.row_count 750
-performance_schema events_stages_summary_by_user_by_event_name.memory 24000
+performance_schema events_stages_summary_by_user_by_event_name.row_count 15000
+performance_schema events_stages_summary_by_user_by_event_name.memory 480000
performance_schema events_stages_summary_by_host_by_event_name.row_size 32
-performance_schema events_stages_summary_by_host_by_event_name.row_count 3000
-performance_schema events_stages_summary_by_host_by_event_name.memory 96000
+performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
+performance_schema events_stages_summary_by_host_by_event_name.memory 480000
performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 167
-performance_schema (pfs_statement_class).memory 32064
+performance_schema (pfs_statement_class).row_count 168
+performance_schema (pfs_statement_class).memory 32256
performance_schema events_statements_history.row_size 3024
-performance_schema events_statements_history.row_count 1120
-performance_schema events_statements_history.memory 3386880
+performance_schema events_statements_history.row_count 4020
+performance_schema events_statements_history.memory 12156480
performance_schema events_statements_history_long.row_size 3024
-performance_schema events_statements_history_long.row_count 100
-performance_schema events_statements_history_long.memory 302400
+performance_schema events_statements_history_long.row_count 10000
+performance_schema events_statements_history_long.memory 30240000
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 37408
-performance_schema events_statements_summary_by_thread_by_event_name.memory 6883072
+performance_schema events_statements_summary_by_thread_by_event_name.row_count 67536
+performance_schema events_statements_summary_by_thread_by_event_name.memory 12426624
performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 167
-performance_schema events_statements_summary_global_by_event_name.memory 30728
+performance_schema events_statements_summary_global_by_event_name.row_count 168
+performance_schema events_statements_summary_global_by_event_name.memory 30912
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 1670
-performance_schema events_statements_summary_by_account_by_event_name.memory 307280
+performance_schema events_statements_summary_by_account_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_account_by_event_name.memory 3091200
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 835
-performance_schema events_statements_summary_by_user_by_event_name.memory 153640
+performance_schema events_statements_summary_by_user_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_user_by_event_name.memory 3091200
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 3340
-performance_schema events_statements_summary_by_host_by_event_name.memory 614560
+performance_schema events_statements_summary_by_host_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_host_by_event_name.memory 3091200
performance_schema events_statements_current.row_size 3024
-performance_schema events_statements_current.row_count 224
-performance_schema events_statements_current.memory 677376
+performance_schema events_statements_current.row_count 402
+performance_schema events_statements_current.memory 1215648
performance_schema (pfs_socket_class).row_size 320
performance_schema (pfs_socket_class).row_count 10
performance_schema (pfs_socket_class).memory 3200
performance_schema socket_instances.row_size 320
-performance_schema socket_instances.row_count 179
-performance_schema socket_instances.memory 57280
+performance_schema socket_instances.row_count 322
+performance_schema socket_instances.memory 103040
performance_schema events_statements_summary_by_digest.row_size 1472
-performance_schema events_statements_summary_by_digest.row_count 1000
-performance_schema events_statements_summary_by_digest.memory 1472000
-performance_schema session_connect_attrs.row_size 224
+performance_schema events_statements_summary_by_digest.row_count 10000
+performance_schema events_statements_summary_by_digest.memory 14720000
+performance_schema session_connect_attrs.row_size 402
performance_schema session_connect_attrs.row_count 512
-performance_schema session_connect_attrs.memory 114688
+performance_schema session_connect_attrs.memory 205824
performance_schema (account_hash).count 2
-performance_schema (account_hash).size 10
+performance_schema (account_hash).size 100
performance_schema (digest_hash).count 0
-performance_schema (digest_hash).size 1000
+performance_schema (digest_hash).size 10000
performance_schema (filename_hash).count 0
-performance_schema (filename_hash).size 1556
+performance_schema (filename_hash).size 7693
performance_schema (host_hash).count 2
-performance_schema (host_hash).size 20
+performance_schema (host_hash).size 100
performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 82
-performance_schema (table_share_hash).size 445
+performance_schema (table_share_hash).count 80
+performance_schema (table_share_hash).size 12500
performance_schema (user_hash).count 2
-performance_schema (user_hash).size 5
+performance_schema (user_hash).size 100
performance_schema host_cache.size 336
-performance_schema performance_schema.memory 35561856
+performance_schema performance_schema.memory 422231328
diff --git a/mysql-test/suite/perfschema/r/sizing_high.result b/mysql-test/suite/perfschema/r/sizing_high.result
index 6e7a1abe8a2..4d63c970782 100644
--- a/mysql-test/suite/perfschema/r/sizing_high.result
+++ b/mysql-test/suite/perfschema/r/sizing_high.result
@@ -26,12 +26,12 @@ performance_schema_max_file_handles 32768
performance_schema_max_file_instances 23385
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 52200
-performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 30800
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 420
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 800
performance_schema_max_table_instances 12500
performance_schema_max_thread_classes 50
@@ -79,8 +79,8 @@ performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 30
-performance_schema (pfs_rwlock_class).memory 9600
+performance_schema (pfs_rwlock_class).row_count 40
+performance_schema (pfs_rwlock_class).memory 12800
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
@@ -99,9 +99,9 @@ performance_schema rwlock_instances.memory 5913600
performance_schema cond_instances.row_size 128
performance_schema cond_instances.row_count 10900
performance_schema cond_instances.memory 1395200
-performance_schema threads.row_size 1856
+performance_schema threads.row_size 2816
performance_schema threads.row_count 500
-performance_schema threads.memory 928000
+performance_schema threads.memory 1408000
performance_schema file_instances.row_size 704
performance_schema file_instances.row_count 23385
performance_schema file_instances.memory 16463040
@@ -109,8 +109,8 @@ performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 186500
-performance_schema events_waits_summary_by_thread_by_event_name.memory 5968000
+performance_schema events_waits_summary_by_thread_by_event_name.row_count 191500
+performance_schema events_waits_summary_by_thread_by_event_name.memory 6128000
performance_schema (pfs_table_share).row_size 22208
performance_schema (pfs_table_share).row_count 12500
performance_schema (pfs_table_share).memory 277600000
@@ -127,23 +127,23 @@ performance_schema (pfs_account).row_size 256
performance_schema (pfs_account).row_count 100
performance_schema (pfs_account).memory 25600
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 37300
-performance_schema events_waits_summary_by_account_by_event_name.memory 1193600
+performance_schema events_waits_summary_by_account_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_account_by_event_name.memory 1225600
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 37300
-performance_schema events_waits_summary_by_user_by_event_name.memory 1193600
+performance_schema events_waits_summary_by_user_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_user_by_event_name.memory 1225600
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 37300
-performance_schema events_waits_summary_by_host_by_event_name.memory 1193600
+performance_schema events_waits_summary_by_host_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_host_by_event_name.memory 1225600
performance_schema (pfs_user).row_size 128
performance_schema (pfs_user).row_count 100
performance_schema (pfs_user).memory 12800
performance_schema (pfs_host).row_size 128
performance_schema (pfs_host).row_count 100
performance_schema (pfs_host).memory 12800
-performance_schema (pfs_stage_class).row_size 192
+performance_schema (pfs_stage_class).row_size 256
performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 28800
+performance_schema (pfs_stage_class).memory 38400
performance_schema events_stages_history.row_size 88
performance_schema events_stages_history.row_count 5000
performance_schema events_stages_history.memory 440000
@@ -166,8 +166,8 @@ performance_schema events_stages_summary_by_host_by_event_name.row_size 32
performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
performance_schema events_stages_summary_by_host_by_event_name.memory 480000
performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 167
-performance_schema (pfs_statement_class).memory 32064
+performance_schema (pfs_statement_class).row_count 168
+performance_schema (pfs_statement_class).memory 32256
performance_schema events_statements_history.row_size 3024
performance_schema events_statements_history.row_count 5000
performance_schema events_statements_history.memory 15120000
@@ -175,20 +175,20 @@ performance_schema events_statements_history_long.row_size 3024
performance_schema events_statements_history_long.row_count 10000
performance_schema events_statements_history_long.memory 30240000
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 83500
-performance_schema events_statements_summary_by_thread_by_event_name.memory 15364000
+performance_schema events_statements_summary_by_thread_by_event_name.row_count 84000
+performance_schema events_statements_summary_by_thread_by_event_name.memory 15456000
performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 167
-performance_schema events_statements_summary_global_by_event_name.memory 30728
+performance_schema events_statements_summary_global_by_event_name.row_count 168
+performance_schema events_statements_summary_global_by_event_name.memory 30912
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 16700
-performance_schema events_statements_summary_by_account_by_event_name.memory 3072800
+performance_schema events_statements_summary_by_account_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_account_by_event_name.memory 3091200
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 16700
-performance_schema events_statements_summary_by_user_by_event_name.memory 3072800
+performance_schema events_statements_summary_by_user_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_user_by_event_name.memory 3091200
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 16700
-performance_schema events_statements_summary_by_host_by_event_name.memory 3072800
+performance_schema events_statements_summary_by_host_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_host_by_event_name.memory 3091200
performance_schema events_statements_current.row_size 3024
performance_schema events_statements_current.row_count 500
performance_schema events_statements_current.memory 1512000
@@ -216,9 +216,9 @@ performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 82
+performance_schema (table_share_hash).count 80
performance_schema (table_share_hash).size 12500
performance_schema (user_hash).count 2
performance_schema (user_hash).size 100
performance_schema host_cache.size 336
-performance_schema performance_schema.memory 421029256
+performance_schema performance_schema.memory 421925632
diff --git a/mysql-test/suite/perfschema/r/sizing_low.result b/mysql-test/suite/perfschema/r/sizing_low.result
index 19c6e36868b..d5aab2c2df3 100644
--- a/mysql-test/suite/perfschema/r/sizing_low.result
+++ b/mysql-test/suite/perfschema/r/sizing_low.result
@@ -26,12 +26,12 @@ performance_schema_max_file_handles 32768
performance_schema_max_file_instances 1556
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 2945
-performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 1612
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 67
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 112
performance_schema_max_table_instances 445
performance_schema_max_thread_classes 50
@@ -79,8 +79,8 @@ performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 30
-performance_schema (pfs_rwlock_class).memory 9600
+performance_schema (pfs_rwlock_class).row_count 40
+performance_schema (pfs_rwlock_class).memory 12800
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
@@ -99,9 +99,9 @@ performance_schema rwlock_instances.memory 309504
performance_schema cond_instances.row_size 128
performance_schema cond_instances.row_count 612
performance_schema cond_instances.memory 78336
-performance_schema threads.row_size 1856
+performance_schema threads.row_size 2816
performance_schema threads.row_count 112
-performance_schema threads.memory 207872
+performance_schema threads.memory 315392
performance_schema file_instances.row_size 704
performance_schema file_instances.row_count 1556
performance_schema file_instances.memory 1095424
@@ -109,8 +109,8 @@ performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 41776
-performance_schema events_waits_summary_by_thread_by_event_name.memory 1336832
+performance_schema events_waits_summary_by_thread_by_event_name.row_count 42896
+performance_schema events_waits_summary_by_thread_by_event_name.memory 1372672
performance_schema (pfs_table_share).row_size 22208
performance_schema (pfs_table_share).row_count 445
performance_schema (pfs_table_share).memory 9882560
@@ -127,23 +127,23 @@ performance_schema (pfs_account).row_size 256
performance_schema (pfs_account).row_count 10
performance_schema (pfs_account).memory 2560
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 3730
-performance_schema events_waits_summary_by_account_by_event_name.memory 119360
+performance_schema events_waits_summary_by_account_by_event_name.row_count 3830
+performance_schema events_waits_summary_by_account_by_event_name.memory 122560
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 1865
-performance_schema events_waits_summary_by_user_by_event_name.memory 59680
+performance_schema events_waits_summary_by_user_by_event_name.row_count 1915
+performance_schema events_waits_summary_by_user_by_event_name.memory 61280
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 7460
-performance_schema events_waits_summary_by_host_by_event_name.memory 238720
+performance_schema events_waits_summary_by_host_by_event_name.row_count 7660
+performance_schema events_waits_summary_by_host_by_event_name.memory 245120
performance_schema (pfs_user).row_size 128
performance_schema (pfs_user).row_count 5
performance_schema (pfs_user).memory 640
performance_schema (pfs_host).row_size 128
performance_schema (pfs_host).row_count 20
performance_schema (pfs_host).memory 2560
-performance_schema (pfs_stage_class).row_size 192
+performance_schema (pfs_stage_class).row_size 256
performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 28800
+performance_schema (pfs_stage_class).memory 38400
performance_schema events_stages_history.row_size 88
performance_schema events_stages_history.row_count 560
performance_schema events_stages_history.memory 49280
@@ -166,8 +166,8 @@ performance_schema events_stages_summary_by_host_by_event_name.row_size 32
performance_schema events_stages_summary_by_host_by_event_name.row_count 3000
performance_schema events_stages_summary_by_host_by_event_name.memory 96000
performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 167
-performance_schema (pfs_statement_class).memory 32064
+performance_schema (pfs_statement_class).row_count 168
+performance_schema (pfs_statement_class).memory 32256
performance_schema events_statements_history.row_size 3024
performance_schema events_statements_history.row_count 560
performance_schema events_statements_history.memory 1693440
@@ -175,20 +175,20 @@ performance_schema events_statements_history_long.row_size 3024
performance_schema events_statements_history_long.row_count 100
performance_schema events_statements_history_long.memory 302400
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 18704
-performance_schema events_statements_summary_by_thread_by_event_name.memory 3441536
+performance_schema events_statements_summary_by_thread_by_event_name.row_count 18816
+performance_schema events_statements_summary_by_thread_by_event_name.memory 3462144
performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 167
-performance_schema events_statements_summary_global_by_event_name.memory 30728
+performance_schema events_statements_summary_global_by_event_name.row_count 168
+performance_schema events_statements_summary_global_by_event_name.memory 30912
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 1670
-performance_schema events_statements_summary_by_account_by_event_name.memory 307280
+performance_schema events_statements_summary_by_account_by_event_name.row_count 1680
+performance_schema events_statements_summary_by_account_by_event_name.memory 309120
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 835
-performance_schema events_statements_summary_by_user_by_event_name.memory 153640
+performance_schema events_statements_summary_by_user_by_event_name.row_count 840
+performance_schema events_statements_summary_by_user_by_event_name.memory 154560
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 3340
-performance_schema events_statements_summary_by_host_by_event_name.memory 614560
+performance_schema events_statements_summary_by_host_by_event_name.row_count 3360
+performance_schema events_statements_summary_by_host_by_event_name.memory 618240
performance_schema events_statements_current.row_size 3024
performance_schema events_statements_current.row_count 112
performance_schema events_statements_current.memory 338688
@@ -216,9 +216,9 @@ performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 82
+performance_schema (table_share_hash).count 80
performance_schema (table_share_hash).size 445
performance_schema (user_hash).count 2
performance_schema (user_hash).size 5
performance_schema host_cache.size 336
-performance_schema performance_schema.memory 24576832
+performance_schema performance_schema.memory 24771616
diff --git a/mysql-test/suite/perfschema/r/sizing_med.result b/mysql-test/suite/perfschema/r/sizing_med.result
index 4fbf4ac08de..c2e7a4df4bf 100644
--- a/mysql-test/suite/perfschema/r/sizing_med.result
+++ b/mysql-test/suite/perfschema/r/sizing_med.result
@@ -26,12 +26,12 @@ performance_schema_max_file_handles 32768
performance_schema_max_file_instances 1754
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 4230
-performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances 2222
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 232
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 573
performance_schema_max_table_instances 556
performance_schema_max_thread_classes 50
@@ -79,8 +79,8 @@ performance_schema (pfs_mutex_class).row_size 256
performance_schema (pfs_mutex_class).row_count 200
performance_schema (pfs_mutex_class).memory 51200
performance_schema (pfs_rwlock_class).row_size 320
-performance_schema (pfs_rwlock_class).row_count 30
-performance_schema (pfs_rwlock_class).memory 9600
+performance_schema (pfs_rwlock_class).row_count 40
+performance_schema (pfs_rwlock_class).memory 12800
performance_schema (pfs_cond_class).row_size 256
performance_schema (pfs_cond_class).row_count 80
performance_schema (pfs_cond_class).memory 20480
@@ -99,9 +99,9 @@ performance_schema rwlock_instances.memory 426624
performance_schema cond_instances.row_size 128
performance_schema cond_instances.row_count 1079
performance_schema cond_instances.memory 138112
-performance_schema threads.row_size 1856
+performance_schema threads.row_size 2816
performance_schema threads.row_count 289
-performance_schema threads.memory 536384
+performance_schema threads.memory 813824
performance_schema file_instances.row_size 704
performance_schema file_instances.row_count 1754
performance_schema file_instances.memory 1234816
@@ -109,8 +109,8 @@ performance_schema (pfs_file_handle).row_size 8
performance_schema (pfs_file_handle).row_count 32768
performance_schema (pfs_file_handle).memory 262144
performance_schema events_waits_summary_by_thread_by_event_name.row_size 32
-performance_schema events_waits_summary_by_thread_by_event_name.row_count 107797
-performance_schema events_waits_summary_by_thread_by_event_name.memory 3449504
+performance_schema events_waits_summary_by_thread_by_event_name.row_count 110687
+performance_schema events_waits_summary_by_thread_by_event_name.memory 3541984
performance_schema (pfs_table_share).row_size 22208
performance_schema (pfs_table_share).row_count 556
performance_schema (pfs_table_share).memory 12347648
@@ -127,23 +127,23 @@ performance_schema (pfs_account).row_size 256
performance_schema (pfs_account).row_count 100
performance_schema (pfs_account).memory 25600
performance_schema events_waits_summary_by_account_by_event_name.row_size 32
-performance_schema events_waits_summary_by_account_by_event_name.row_count 37300
-performance_schema events_waits_summary_by_account_by_event_name.memory 1193600
+performance_schema events_waits_summary_by_account_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_account_by_event_name.memory 1225600
performance_schema events_waits_summary_by_user_by_event_name.row_size 32
-performance_schema events_waits_summary_by_user_by_event_name.row_count 37300
-performance_schema events_waits_summary_by_user_by_event_name.memory 1193600
+performance_schema events_waits_summary_by_user_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_user_by_event_name.memory 1225600
performance_schema events_waits_summary_by_host_by_event_name.row_size 32
-performance_schema events_waits_summary_by_host_by_event_name.row_count 37300
-performance_schema events_waits_summary_by_host_by_event_name.memory 1193600
+performance_schema events_waits_summary_by_host_by_event_name.row_count 38300
+performance_schema events_waits_summary_by_host_by_event_name.memory 1225600
performance_schema (pfs_user).row_size 128
performance_schema (pfs_user).row_count 100
performance_schema (pfs_user).memory 12800
performance_schema (pfs_host).row_size 128
performance_schema (pfs_host).row_count 100
performance_schema (pfs_host).memory 12800
-performance_schema (pfs_stage_class).row_size 192
+performance_schema (pfs_stage_class).row_size 256
performance_schema (pfs_stage_class).row_count 150
-performance_schema (pfs_stage_class).memory 28800
+performance_schema (pfs_stage_class).memory 38400
performance_schema events_stages_history.row_size 88
performance_schema events_stages_history.row_count 2890
performance_schema events_stages_history.memory 254320
@@ -166,8 +166,8 @@ performance_schema events_stages_summary_by_host_by_event_name.row_size 32
performance_schema events_stages_summary_by_host_by_event_name.row_count 15000
performance_schema events_stages_summary_by_host_by_event_name.memory 480000
performance_schema (pfs_statement_class).row_size 192
-performance_schema (pfs_statement_class).row_count 167
-performance_schema (pfs_statement_class).memory 32064
+performance_schema (pfs_statement_class).row_count 168
+performance_schema (pfs_statement_class).memory 32256
performance_schema events_statements_history.row_size 3024
performance_schema events_statements_history.row_count 2890
performance_schema events_statements_history.memory 8739360
@@ -175,20 +175,20 @@ performance_schema events_statements_history_long.row_size 3024
performance_schema events_statements_history_long.row_count 1000
performance_schema events_statements_history_long.memory 3024000
performance_schema events_statements_summary_by_thread_by_event_name.row_size 184
-performance_schema events_statements_summary_by_thread_by_event_name.row_count 48263
-performance_schema events_statements_summary_by_thread_by_event_name.memory 8880392
+performance_schema events_statements_summary_by_thread_by_event_name.row_count 48552
+performance_schema events_statements_summary_by_thread_by_event_name.memory 8933568
performance_schema events_statements_summary_global_by_event_name.row_size 184
-performance_schema events_statements_summary_global_by_event_name.row_count 167
-performance_schema events_statements_summary_global_by_event_name.memory 30728
+performance_schema events_statements_summary_global_by_event_name.row_count 168
+performance_schema events_statements_summary_global_by_event_name.memory 30912
performance_schema events_statements_summary_by_account_by_event_name.row_size 184
-performance_schema events_statements_summary_by_account_by_event_name.row_count 16700
-performance_schema events_statements_summary_by_account_by_event_name.memory 3072800
+performance_schema events_statements_summary_by_account_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_account_by_event_name.memory 3091200
performance_schema events_statements_summary_by_user_by_event_name.row_size 184
-performance_schema events_statements_summary_by_user_by_event_name.row_count 16700
-performance_schema events_statements_summary_by_user_by_event_name.memory 3072800
+performance_schema events_statements_summary_by_user_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_user_by_event_name.memory 3091200
performance_schema events_statements_summary_by_host_by_event_name.row_size 184
-performance_schema events_statements_summary_by_host_by_event_name.row_count 16700
-performance_schema events_statements_summary_by_host_by_event_name.memory 3072800
+performance_schema events_statements_summary_by_host_by_event_name.row_count 16800
+performance_schema events_statements_summary_by_host_by_event_name.memory 3091200
performance_schema events_statements_current.row_size 3024
performance_schema events_statements_current.row_count 289
performance_schema events_statements_current.memory 873936
@@ -216,9 +216,9 @@ performance_schema (setup_actor_hash).count 1
performance_schema (setup_actor_hash).size 100
performance_schema (setup_object_hash).count 4
performance_schema (setup_object_hash).size 100
-performance_schema (table_share_hash).count 82
+performance_schema (table_share_hash).count 80
performance_schema (table_share_hash).size 556
performance_schema (user_hash).count 2
performance_schema (user_hash).size 100
performance_schema host_cache.size 336
-performance_schema performance_schema.memory 70366560
+performance_schema performance_schema.memory 70954032
diff --git a/mysql-test/suite/perfschema/r/sizing_off.result b/mysql-test/suite/perfschema/r/sizing_off.result
index 79059b7efb4..0d95a8c0f1b 100644
--- a/mysql-test/suite/perfschema/r/sizing_off.result
+++ b/mysql-test/suite/perfschema/r/sizing_off.result
@@ -17,12 +17,12 @@ performance_schema_max_file_handles 32768
performance_schema_max_file_instances -1
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances -1
-performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_classes 40
performance_schema_max_rwlock_instances -1
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances -1
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles -1
performance_schema_max_table_instances -1
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_idle.result b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
index 9dadf114965..9f22ca75162 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
index 029fe5bc77c..d73d7920cd7 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
index 5333d069dbd..af5fbb00d15 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
index 7742ebe4a35..92f50e0a699 100644
--- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result
+++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result
index c06877957f8..ac5d03945c2 100644
--- a/mysql-test/suite/perfschema/r/start_server_innodb.result
+++ b/mysql-test/suite/perfschema/r/start_server_innodb.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result
index 4da846879cb..d45e9a77910 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_account.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_account.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result
index 2495e05771a..fb7eb60c915 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
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
index f6c8c6b23fa..3fa4ed1a43d 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
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result
index 22f157e89a1..6079cb7fbdf 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
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result
index 5af19971f83..786c8a6cb96 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
@@ -88,12 +88,12 @@ performance_schema_max_file_handles 32768
performance_schema_max_file_instances 0
performance_schema_max_mutex_classes 200
performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result
index e3c839cdc83..26b736922fe 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_host.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_host.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
index 7d0a109f275..77210f4253f 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
@@ -88,12 +88,12 @@ performance_schema_max_file_handles 32768
performance_schema_max_file_instances 10000
performance_schema_max_mutex_classes 0
performance_schema_max_mutex_instances 5000
-performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
index 0ae98d17a0e..ca2ce3114c9 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
@@ -88,12 +88,12 @@ performance_schema_max_file_handles 32768
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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
index d532f1d95a9..252c6c7f0aa 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
@@ -93,7 +93,7 @@ performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
performance_schema_max_stage_classes 150
-performance_schema_max_statement_classes 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
index cfece945775..e7655a314ea 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
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
@@ -106,7 +106,7 @@ show engine PERFORMANCE_SCHEMA status;
show status like "performance_schema%";
show variables like "performance_schema_max_rwlock_classes";
Variable_name Value
-performance_schema_max_rwlock_classes 30
+performance_schema_max_rwlock_classes 40
select count(*) > 0 from performance_schema.setup_instruments
where name like "wait/synch/rwlock/%";
count(*) > 0
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
index cf34d7f4da7..48c0574912f 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
index 72cdd2a4ba9..aecc8fa1bd0 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
index 298eac742b9..d247a9b148d 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
index c48c691a1e5..6682121bd99 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
index fb35765784b..41275012bfa 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
index f227ca1d8df..0e367945cfc 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
index be920eae15d..aa3de1ab7cd 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
index 11113ef5d7d..78fe9223ef4 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statement_class.result
@@ -88,7 +88,7 @@ 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_classes 40
performance_schema_max_rwlock_instances 5000
performance_schema_max_socket_classes 10
performance_schema_max_socket_instances 1000
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
index ad7bdfd8621..d890992ac83 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
index 26917ae12ae..62b3290d7ed 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
index 6d7e98b3900..0e5837c9eaf 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 0
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
index 488288b0d49..72347f14160 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 0
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result
index 3ff4ad4c967..e5dd500c316 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
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 0
diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
index 9dbd82481b3..d36c2b30441 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
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result
index 4a32b5f64dc..89efe84d938 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_user.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_user.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
index a8db4e9facc..81e999bc0ee 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
index 15290249ae2..bca3594c225 100644
--- a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
+++ b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result
index 1ee789b6f7c..f5249dc2039 100644
--- a/mysql-test/suite/perfschema/r/start_server_off.result
+++ b/mysql-test/suite/perfschema/r/start_server_off.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result
index c06877957f8..ac5d03945c2 100644
--- a/mysql-test/suite/perfschema/r/start_server_on.result
+++ b/mysql-test/suite/perfschema/r/start_server_on.result
@@ -88,12 +88,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
index 362136696e0..e59a03324dd 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
index 2c906396f4c..bb1fc975cd9 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
index f5a5cbf3c38..ae067698e2d 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
index fef1343d76a..333d3844867 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
index cac68b459bf..61af4a203c9 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
@@ -56,12 +56,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
index 713b14bbce8..ba109d45783 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
@@ -55,12 +55,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
index 9cddb9d309f..f19d737061d 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
@@ -56,12 +56,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
index 8f1dff97c2f..05c4be28be3 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
@@ -55,12 +55,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result
index 00aea8a6773..50935c7afbe 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_off.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
index 87fec96f45a..83345b6edda 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
index 00c2c8c13c9..b53f0696f56 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
index edc3c4de062..3b8f6326031 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
index 0cc1cf417a5..023ff3760c7 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
index c162505fd97..df42b39c726 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
index 897df97a07d..30b48d59253 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
index 5f192271112..4804265562c 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
index 9aebdcf9e3b..086957fa25e 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
index add84e004bb..08356e894da 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
index 69a2cb891e7..e60acb62ff7 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
index 77ddae26b33..5593fd8ec85 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
index b82579cc782..0fd700c86ac 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
index 21f443f1343..c4c98c1143f 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
index 3b54bd4a37b..3563e7bb366 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
index 3243cfbbe32..0cf5970111d 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
index 09666783a25..c94d2192f22 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
index 55c8f2a2d22..84074f4d0ce 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
index 521a0505c62..413b70c17bd 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
index 0f105eb59b8..dfa300a09ed 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
index c37d794f4d7..b4ca5202558 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
index 5c0f82e07a5..50aeea5363a 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
index a5dea0b24d2..eeea805e941 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
index d0cbc4ade9f..ce9e0aeff85 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
@@ -58,12 +58,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
index 41619c0b145..2ecd7d56411 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
@@ -57,12 +57,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
index 28cbc4bfb0b..372ed695675 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
index 30e7b7d7f81..3f1e78a46da 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
index a4699ce7a7c..d88e8f4d49a 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
@@ -60,12 +60,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
index 4970077987c..7b90426f3f8 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
@@ -59,12 +59,12 @@ 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_classes 40
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 167
+performance_schema_max_statement_classes 168
performance_schema_max_table_handles 1000
performance_schema_max_table_instances 500
performance_schema_max_thread_classes 50
diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test
index 672737ae2a7..326c0e763d9 100644
--- a/mysql-test/suite/perfschema/t/aggregate.test
+++ b/mysql-test/suite/perfschema/t/aggregate.test
@@ -3,6 +3,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
+--source include/have_QC_Disabled.inc
--echo "General cleanup"
diff --git a/mysql-test/suite/perfschema/t/disabled.def b/mysql-test/suite/perfschema/t/disabled.def
index d7d43ccaefc..888298bbb09 100644
--- a/mysql-test/suite/perfschema/t/disabled.def
+++ b/mysql-test/suite/perfschema/t/disabled.def
@@ -9,6 +9,3 @@
# Do not use any TAB characters for whitespace.
#
##############################################################################
-hostcache_ipv4_max_con : BUG#14627287 27th Sept, 2012 Mayank
-hostcache_ipv6_max_con : BUG#14627287 27th Sept, 2012 Mayank
-
diff --git a/mysql-test/suite/perfschema/t/event_aggregate.test b/mysql-test/suite/perfschema/t/event_aggregate.test
index c1a895ec549..2f49fc40190 100644
--- a/mysql-test/suite/perfschema/t/event_aggregate.test
+++ b/mysql-test/suite/perfschema/t/event_aggregate.test
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a.test
index c1a895ec549..2f49fc40190 100644
--- a/mysql-test/suite/perfschema/t/event_aggregate_no_a.test
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_a.test
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
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
index c1a895ec549..2f49fc40190 100644
--- 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
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
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
index c1a895ec549..2f49fc40190 100644
--- 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
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
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
index c1a895ec549..2f49fc40190 100644
--- 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
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_h.test
index c1a895ec549..2f49fc40190 100644
--- a/mysql-test/suite/perfschema/t/event_aggregate_no_h.test
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_h.test
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_u.test b/mysql-test/suite/perfschema/t/event_aggregate_no_u.test
index c1a895ec549..2f49fc40190 100644
--- a/mysql-test/suite/perfschema/t/event_aggregate_no_u.test
+++ b/mysql-test/suite/perfschema/t/event_aggregate_no_u.test
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
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
index c1a895ec549..2f49fc40190 100644
--- 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
@@ -4,4 +4,4 @@
--source ../include/event_aggregate_setup.inc
--source ../include/event_aggregate_load.inc
--source ../include/event_aggregate_cleanup.inc
-
+--source include/have_QC_Disabled.inc
diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test
index 014ab5e0731..2055fa9a008 100644
--- a/mysql-test/suite/perfschema/t/func_file_io.test
+++ b/mysql-test/suite/perfschema/t/func_file_io.test
@@ -16,6 +16,7 @@ update performance_schema.threads SET instrumented = 'YES'
WHERE PROCESSLIST_ID=connection_id();
# reset lost counters
+truncate table performance_schema.events_statements_summary_by_digest;
flush status;
--disable_warnings
diff --git a/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-test/suite/perfschema/t/func_mutex.test
index f8f85274b93..3b0803eaedb 100644
--- a/mysql-test/suite/perfschema/t/func_mutex.test
+++ b/mysql-test/suite/perfschema/t/func_mutex.test
@@ -14,6 +14,7 @@ WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
# reset lost counters
+truncate table performance_schema.events_statements_summary_by_digest;
flush status;
# Make sure objects are instrumented
diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
index 2699121ff62..612efd18a82 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_blocked.test
@@ -18,10 +18,13 @@
select @@global.max_connect_errors into @saved_max_connect_errors;
-set global max_connect_errors = 2;
+set global max_connect_errors = 3;
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+create user 'quota'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
+
connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
select "Con1 is alive";
select current_user();
@@ -31,7 +34,7 @@ disconnect con1;
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
+--error ER_HANDSHAKE_ERROR
connect (con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@@ -39,7 +42,7 @@ connect (con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
---error ER_ACCESS_DENIED_ERROR
+--error ER_HANDSHAKE_ERROR
connect (con2b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@@ -47,7 +50,7 @@ connect (con2b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
---error ER_ACCESS_DENIED_ERROR
+--error ER_HANDSHAKE_ERROR
connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@@ -74,8 +77,71 @@ connect (con2e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
flush hosts;
--disable_query_log
---error ER_ACCESS_DENIED_ERROR
-connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--error ER_HANDSHAKE_ERROR
+connect (con3a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+connect (con3b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--connection default
+set global debug= "-d,native_password_bad_reply";
+
+--disable_query_log
+connect (con4,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+select "Valid connection should reset SUM_CONNECT_ERROR counter" as message;
+--disconnect con4
+--enable_query_log
+
+--connection default
+set global debug= "+d,native_password_bad_reply";
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+connect (con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+connect (con5b,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+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_HOST_IS_BLOCKED
+connect (con5d,"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 (con5e,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
@@ -84,6 +150,9 @@ connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,);
revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
drop user 'root'@'santa.claus.ipv4.example.com';
+revoke select on test.* from 'quota'@'santa.claus.ipv4.example.com';
+drop user 'quota'@'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_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
index b80efc222dc..e6d2c168a16 100644
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test
@@ -19,10 +19,13 @@
select @@global.max_connect_errors into @saved_max_connect_errors;
-set global max_connect_errors = 2;
+set global max_connect_errors = 3;
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+create user 'quota'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
+
connect (con1,"::1",root,,test,$MASTER_MYPORT,);
select "Con1 is alive";
select current_user();
@@ -32,7 +35,7 @@ disconnect con1;
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
+--error ER_HANDSHAKE_ERROR
connect (con2a,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@@ -40,7 +43,7 @@ connect (con2a,"::1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
---error ER_ACCESS_DENIED_ERROR
+--error ER_HANDSHAKE_ERROR
connect (con2b,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@@ -48,7 +51,7 @@ connect (con2b,"::1",quota,,test,$MASTER_MYPORT,);
--source ../include/hostcache_dump.inc
--disable_query_log
---error ER_ACCESS_DENIED_ERROR
+--error ER_HANDSHAKE_ERROR
connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
@@ -75,8 +78,71 @@ connect (con2e,"::1",quota,,test,$MASTER_MYPORT,);
flush hosts;
--disable_query_log
---error ER_ACCESS_DENIED_ERROR
-connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
+--error ER_HANDSHAKE_ERROR
+connect (con3a,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+connect (con3b,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--connection default
+set global debug= "-d,native_password_bad_reply";
+
+--disable_query_log
+connect (con4,"::1",quota,,test,$MASTER_MYPORT,);
+select "Valid connection should reset SUM_CONNECT_ERROR counter" as message;
+--disconnect con4
+--enable_query_log
+
+--connection default
+set global debug= "+d,native_password_bad_reply";
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+connect (con5a,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+connect (con5b,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HANDSHAKE_ERROR
+connect (con5c,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_IS_BLOCKED
+connect (con5d,"::1",quota,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_HOST_IS_BLOCKED
+connect (con5e,"::1",quota,,test,$MASTER_MYPORT,);
--enable_query_log
--connection default
@@ -85,6 +151,9 @@ connect (con2c,"::1",quota,,test,$MASTER_MYPORT,);
revoke select on test.* from 'root'@'santa.claus.ipv6.example.com';
drop user 'root'@'santa.claus.ipv6.example.com';
+revoke select on test.* from 'quota'@'santa.claus.ipv6.example.com';
+drop user 'quota'@'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/myisam_file_io.test b/mysql-test/suite/perfschema/t/myisam_file_io.test
index 5888c29fe22..786ae88e8b9 100644
--- a/mysql-test/suite/perfschema/t/myisam_file_io.test
+++ b/mysql-test/suite/perfschema/t/myisam_file_io.test
@@ -15,6 +15,7 @@ update performance_schema.setup_consumers
truncate table performance_schema.events_waits_history_long;
# Reset lost counters to a known state
+truncate table performance_schema.events_statements_summary_by_digest;
flush status;
# Code to test
diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test
index 9b1458dca5d..4535e0e04f7 100644
--- a/mysql-test/suite/perfschema/t/nesting.test
+++ b/mysql-test/suite/perfschema/t/nesting.test
@@ -7,6 +7,7 @@
--source include/not_windows.inc
--source ../include/no_protocol.inc
--source ../include/wait_for_pfs_thread_count.inc
+--source include/have_QC_Disabled.inc
--disable_query_log
@@ -45,11 +46,12 @@ update performance_schema.setup_instruments set enabled='YES', timed='YES'
update performance_schema.setup_instruments set enabled='YES', timed='YES'
where name in ('statement/sql/select',
- 'statement/com/',
- 'statement/com/Query',
+ 'statement/abstract/new_packet',
+ 'statement/abstract/Query',
'statement/com/error');
# Start from a known clean state, to avoid noise from previous tests
+truncate table performance_schema.events_statements_summary_by_digest;
flush tables;
flush status;
diff --git a/mysql-test/suite/perfschema/t/ortho_iter.test b/mysql-test/suite/perfschema/t/ortho_iter.test
index 09ecfa8a788..0856e266386 100644
--- a/mysql-test/suite/perfschema/t/ortho_iter.test
+++ b/mysql-test/suite/perfschema/t/ortho_iter.test
@@ -44,7 +44,8 @@ begin
select count(name)
from performance_schema.setup_instruments
- where name like (concat(instr_name, "%"))
+ where (name like (concat(instr_name, "%")))
+ and (not name like "%/abstract/%")
into count_expected;
set cmd_1= "select count(*) from (select distinct event_name from performance_schema.";
@@ -138,6 +139,7 @@ call check_instrument("wait/");
call check_instrument("stage/");
call check_instrument("statement/com/");
call check_instrument("statement/sql/");
+call check_instrument("statement/abstract/");
call check_instrument("statement/");
call check_instrument("idle/io/socket");
call check_instrument("idle/");
diff --git a/mysql-test/suite/perfschema/t/rpl_statements-master.opt b/mysql-test/suite/perfschema/t/rpl_statements-master.opt
new file mode 100644
index 00000000000..01cf3e0520f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/rpl_statements-master.opt
@@ -0,0 +1 @@
+--binlog-format=mixed
diff --git a/mysql-test/suite/perfschema/t/rpl_statements-slave.opt b/mysql-test/suite/perfschema/t/rpl_statements-slave.opt
new file mode 100644
index 00000000000..01cf3e0520f
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/rpl_statements-slave.opt
@@ -0,0 +1 @@
+--binlog-format=mixed
diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test
new file mode 100644
index 00000000000..8e719610ba9
--- /dev/null
+++ b/mysql-test/suite/perfschema/t/rpl_statements.test
@@ -0,0 +1,338 @@
+#
+# Check statement instrumentation of replicated statements
+#
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+--source ../include/no_protocol.inc
+--source include/have_binlog_format_mixed.inc
+--source include/master-slave.inc
+
+#==============================================================
+# Execute a variety of dml and ddl statements on the master.
+# Verify that the corresponding statement events are generated
+# on the slave.
+#
+# 1. Setup test files on master
+# 2. Replicate test files to slave
+# 3. Perform dml and ddl statements on master
+# 4. Copy statement events on master into a temporary table
+# 4. Replicate to slave
+# 5. Compare statement events on slave to those from the master
+# 6. Disable statement/abstract/relay_log on slave
+# 7. Update some tables on the master then replicate
+# 8. Verify that the updates were replicated but no statement
+# events were recorded
+#==============================================================
+
+#
+# UTILITY QUERIES
+#
+let $get_thread_id=
+ select thread_id into @my_thread_id
+ from performance_schema.threads
+ where processlist_id = connection_id();
+
+let $disable_instruments=
+ update performance_schema.setup_instruments
+ set enabled='no', timed='no'
+ where name like '%statement/%';
+
+let $enable_instruments= ../include
+ update performance_schema.setup_instruments
+ set enabled='yes', timed='yes'
+ where name like '%statement/%';
+
+let $column_list=
+ thread_id, event_id, rpad(event_name, 28, ' ') event_name, rpad(current_schema, 10, ' ') current_schema, rpad(digest_text, 72, ' ') digest_text, sql_text;
+
+# Define instrument name for enable/disable instruments
+let $pfs_instrument='%statement/%';
+
+--echo
+--echo #
+--echo # STEP 1 - CREATE AND REPLICATE TEST TABLES
+--echo #
+
+connection master;
+
+--echo
+--echo **************
+--echo *** MASTER ***
+--echo **************
+--echo
+--echo *** Create test tables
+--echo
+
+show variables like '%binlog_format%';
+
+--disable_warnings
+drop table if exists test.marker;
+--enable_warnings
+
+eval $get_thread_id;
+
+create table test.marker(s1 int) engine=innodb;
+
+sync_slave_with_master;
+
+--echo **************
+--echo *** SLAVE ***
+--echo **************
+--echo
+--echo *** Clear statement events
+--source ../include/rpl_statements_truncate.inc
+
+--echo
+--echo #
+--echo # STEP 2 - REPLICATE ONE ROW ON MASTER TO GET REPLICATION THREAD ID ON SLAVE
+--echo #
+
+connection master;
+
+--echo **************
+--echo *** MASTER ***
+--echo **************
+--echo
+insert into test.marker values (0);
+--echo
+
+sync_slave_with_master;
+
+--echo **************
+--echo *** SLAVE ***
+--echo **************
+--echo
+--echo *** Verify row, get replication thread id, clear statement events
+--echo
+
+# TODO: Get slave thread id from threads using thread/sql/slave_sql event name
+
+select thread_id into @slave_thread_id from performance_schema.events_statements_history
+ where sql_text like '%marker%';
+let $slave_thread_id= `select @slave_thread_id`;
+
+--echo *** Verify row inserted on master was replicated
+select count(*) = 1 as 'Expect 1' from test.marker;
+
+--echo *** Clear statement events
+--source ../include/rpl_statements_truncate.inc
+
+--echo
+--echo #
+--echo # STEP 3 - PERFORM DML STATEMENTS ON MASTER
+--echo #
+
+connection master;
+
+--echo **************
+--echo *** MASTER ***
+--echo **************
+--echo
+show variables like '%binlog_format%';
+
+--echo *** Clear statement events
+--source ../include/rpl_statements_truncate.inc
+
+--echo
+--echo *** Create/drop table, create/drop database
+--echo
+create database marker1_db;
+create database marker2_db;
+create table marker1_db.table1 (s1 int) engine=innodb;
+create table marker2_db.table1 (s1 int) engine=innodb;
+create table marker2_db.table2 (s1 int) engine=innodb;
+
+--echo
+--echo *** Transaction
+start transaction;
+insert into marker1_db.table1 values (1), (2), (3);
+insert into marker2_db.table1 values (1), (2), (3);
+commit;
+
+--echo
+--echo *** Alter
+alter table marker1_db.table1 add column (s2 varchar(32));
+
+--echo
+--echo *** Insert, Update
+start transaction;
+insert into marker1_db.table1 values (4, 'four'), (5, 'five'), (6, 'six');
+update marker1_db.table1 set s1 = s1 + 1;
+commit;
+
+--echo
+--echo *** Rollback
+start transaction;
+insert into marker1_db.table1 values (7, 'seven'), (8, 'eight'), (9, 'nine');
+rollback;
+
+--echo
+--echo *** Autocommit, Delete, Drop
+delete from marker1_db.table1 where s1 > 4;
+drop table marker2_db.table1;
+drop database marker2_db;
+
+--source ../include/disable_instruments.inc
+
+--echo
+--echo *** Examine statements events that will be compared on the slave
+--echo
+
+--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
+
+eval select $column_list from performance_schema.events_statements_history_long
+ where sql_text like '%marker%' order by event_id;
+
+--echo
+--echo #
+--echo # STEP 4 - REPLICATE STATEMENT EVENTS ON MASTER TO SLAVE
+--echo #
+--echo
+--echo *** Store statement events in holding table, then replicate
+--echo
+
+--source ../include/disable_instruments.inc
+
+--echo #
+--echo # Create table to hold statement events for later comparison on the slave
+--echo #
+
+create table test.master_events_statements_history_long as
+ (select thread_id, event_id, event_name, sql_text, digest, digest_text, current_schema, rows_affected
+ from performance_schema.events_statements_history_long
+ where (thread_id=@my_thread_id and digest_text like '%marker%'));
+
+--source ../include/enable_instruments.inc
+
+--echo
+--echo #
+--echo # STEP 5 - VERIFY DML AND DDL STATEMENT EVENTS ON SLAVE
+--echo #
+
+sync_slave_with_master;
+
+--echo **************
+--echo *** SLAVE ***
+--echo **************
+
+--source ../include/disable_instruments.inc
+
+--echo
+--echo *** List statement events from master
+--echo
+--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
+eval select $column_list from master_events_statements_history_long order by event_id;
+
+--echo
+--echo *** List statement events on slave
+--echo
+
+--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
+
+eval select $column_list from performance_schema.events_statements_history_long
+ where thread_id = @slave_thread_id and sql_text like '%marker%' order by event_id;
+
+--echo
+--echo *** Compare master and slave events
+--echo
+
+# Note: The statement digest provides a more robust comparison than the
+# event name. However, in some cases, e.g. DROP TABLE, the server generates
+# its own version of the statement which includes additional quotes and a
+# comment. A digest comparison is therefore impractical for server-generated
+# statements, so we use both methods to ensure coverage.
+
+--echo
+--echo *** Event name comparison - expect 0 mismatches
+--echo
+
+select thread_id, event_id, event_name, digest_text, sql_text from performance_schema.events_statements_history_long t1
+ where t1.thread_id = @slave_thread_id and
+ sql_text like '%marker%' and
+ not exists (select * from master_events_statements_history_long t2 where t2.event_name = t1.event_name);
+
+--echo
+--echo *** Statement digest comparison - expect 1 mismatch for DROP TABLE
+--echo
+
+--replace_column 1 [THREAD_ID] 2 [EVENT_ID] 4 [DIGEST]
+
+select thread_id, event_id, event_name, digest, digest_text, sql_text from performance_schema.events_statements_history_long t1
+ where t1.thread_id = @slave_thread_id and
+ sql_text like '%marker%' and
+ not exists (select * from master_events_statements_history_long t2 where t2.digest = t1.digest);
+
+--echo
+--echo #
+--echo # STEP 6 - DISABLE REPLICATED STATEMENT EVENTS ON SLAVE
+--echo #
+--source ../include/rpl_statements_truncate.inc
+--source ../include/enable_instruments.inc
+
+update performance_schema.setup_instruments set enabled='no', timed='no'
+ where name like '%statement/abstract/relay_log%';
+
+select * from performance_schema.setup_instruments where name like '%statement/abstract/relay_log%';
+
+--echo
+--echo #
+--echo # STEP 7 - UPDATE TABLES ON MASTER, REPLICATE
+--echo #
+
+connection master;
+
+--echo **************
+--echo *** MASTER ***
+--echo **************
+--echo
+--echo *** Clear statement events
+--source ../include/rpl_statements_truncate.inc
+
+--echo *** Update some tables, then replicate
+--echo
+
+insert into marker1_db.table1 values (999, '999'), (998, '998'), (997, '997');
+
+--echo
+--echo #
+--echo # STEP 8 - VERIFY TABLE UPDATES FROM MASTER, EXPECT NO STATEMENT EVENTS ON SLAVE
+--echo #
+
+sync_slave_with_master;
+
+--echo **************
+--echo *** SLAVE ***
+--echo **************
+--echo
+--echo *** Confirm rows were replicated
+--echo
+
+select * from marker1_db.table1 where s1 > 900 order by s1;
+
+--echo
+--echo *** Confirm that are no statements events from the replication thread
+--echo
+
+select * from performance_schema.events_statements_history_long
+ where thread_id = @slave_thread_id;
+
+--source ../include/enable_instruments.inc
+
+--echo
+--echo #
+--echo # STEP 9 - CLEAN UP
+--echo #
+--echo
+--disable_query_log
+--disable_warnings
+
+connection master;
+drop table test.marker;
+drop table test.master_events_statements_history_long;
+drop database marker1_db;
+
+sync_slave_with_master;
+
+--enable_warnings
+--enable_query_log
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt b/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
index 71106aaaed0..eec7d4af545 100644
--- a/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
+++ b/mysql-test/suite/perfschema/t/setup_instruments_defaults-master.opt
@@ -1,21 +1,30 @@
+--no-console
--log-error=0
--loose-performance-schema-instrument='%=ON'
+--loose-performance-schema-instrument=''
+--loose-performance-schema-instrument=' wait/synch/mutex/sql/% = OFF ''
+--loose-performance-schema-instrument='//wait/synch/mutex/sql/% = 'OFF ''
+--loose-performance-schema-instrument=' wait/synch/mutex/sql/% = OFF '
+--loose-performance-schema-instrument='''''
+--loose-performance-schema-instrument=' / '
+--loose-performance-schema-instrument=' wait/synch/mutex/sql/% = OFF '
--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_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='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='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/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
index b84b082c484..cfddfd9f1e6 100644
--- a/mysql-test/suite/perfschema/t/setup_instruments_defaults.test
+++ b/mysql-test/suite/perfschema/t/setup_instruments_defaults.test
@@ -4,14 +4,18 @@
--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
+# performance_schema.setup_instruments table. These instruments that are known to persist across
# platforms and the various compile options.
+--echo #
+--echo # Verify that the configuration file defaults were processed correctly
+--echo #
+
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'
+ 'wait/synch/mutex/sql/LOCK_xid_cache',
'stage/sql/creating table')
AND enabled = 'yes' AND timed = 'no'
ORDER BY name;
@@ -28,13 +32,52 @@ 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')
+WHERE name = '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
+--echo #
+--echo # Verify that the instrument startup settings are not not visible.
+--echo #
+SHOW VARIABLES LIKE "%/wait/synch/mutex%";
+
+--echo #
+--echo # Verify command line options are processed correctly
+--echo #
+
+# The instrument wait/io/table/sql/handler should be enabled and timed. We will
+# restart the server with the instrument disabled from the command line.
+--echo #
+--echo # Verify that wait/io/table/sql/handler is enabled and timed
+--echo #
+SELECT * FROM performance_schema.setup_instruments
+WHERE name like "%wait/io/table/sql/handler%";
+
+# Write file to make mysql-test-run.pl wait for the server to stop
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Restart the server
+--echo #
+--echo # Stop server
+--send_shutdown
+--echo # Restart server with wait/io/table/sql/handler disabled
+
+--exec echo "restart:--loose-performance-schema-instrument='%wait/io/table/sql/%=off'" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+
+# Turn on reconnect
+--echo # Enable reconnect
+--enable_reconnect
+
+# Wait for server to be back online again
+--echo # Wait until connected again
+--source include/wait_until_connected_again.inc
+
+# Turn off reconnect again
+--echo # Disable reconnect
+--disable_reconnect
+
+--echo #
+--echo # Verify that wait/io/table is disabled
+--echo #
+SELECT * FROM performance_schema.setup_instruments
+WHERE name like "%wait/io/table/sql/handler%";
diff --git a/mysql-test/suite/perfschema/t/sizing_default.cnf b/mysql-test/suite/perfschema/t/sizing_default.cnf
index 1e99e180b79..6a929998329 100644
--- a/mysql-test/suite/perfschema/t/sizing_default.cnf
+++ b/mysql-test/suite/perfschema/t/sizing_default.cnf
@@ -4,10 +4,13 @@
[mysqld.1]
# Default values used in the server, out of the box
-table_definition_cache=400
-table_open_cache=400
-max_connections=151
-open_files_limit=1024
+# open_files_limit can be scaled down based on the os configuration (ulimit -n),
+# so to get a stable test output, make sure ulimit -n is big enough
+#
+# What is supposed to happen here by default:
+# table_open_cache = 2000
+# table_definition_cache = 400 + 2000/2 = 1400
+# max_connections = 151
# Automated sizing for everything
diff --git a/mysql-test/suite/perfschema/t/sizing_default.test b/mysql-test/suite/perfschema/t/sizing_default.test
index 4d02d41aecd..d5fb8be9f77 100644
--- a/mysql-test/suite/perfschema/t/sizing_default.test
+++ b/mysql-test/suite/perfschema/t/sizing_default.test
@@ -5,5 +5,27 @@
--source include/not_valgrind.inc
--source ../include/have_aligned_memory.inc
+# Skip test if not defaults is used.
+let $max_open_files_limit= `SELECT @@open_files_limit < 5000`;
+if ($max_open_files_limit)
+{
+ skip Need open_files_limit to be at least 5000;
+}
+let $max_table_open_cache= `SELECT @@table_open_cache != 2000`;
+if ($max_table_open_cache)
+{
+ skip Need table_open_cache to be exactly 2000;
+}
+let $max_table_definition_cache= `SELECT @@table_definition_cache != 1400`;
+if ($max_table_definition_cache)
+{
+ skip Need table_definition_cache to be exactly 1400;
+}
+let $max_connections= `SELECT @@max_connections != 151`;
+if ($max_connections)
+{
+ skip Need max_connections to be exactly 151;
+}
+
--source ../include/sizing_auto.inc
diff --git a/mysql-test/suite/perfschema/t/view_table_io.test b/mysql-test/suite/perfschema/t/view_table_io.test
index 703f5414ba4..f8e545e094e 100644
--- a/mysql-test/suite/perfschema/t/view_table_io.test
+++ b/mysql-test/suite/perfschema/t/view_table_io.test
@@ -6,6 +6,7 @@
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source ../include/table_io_setup_helper.inc
+--source include/have_QC_Disabled.inc
let $engine_type= MyISAM;
let $table_item= test.v1;
diff --git a/storage/perfschema/cursor_by_account.cc b/storage/perfschema/cursor_by_account.cc
index 91e9e3c6e54..6be69f803b2 100644
--- a/storage/perfschema/cursor_by_account.cc
+++ b/storage/perfschema/cursor_by_account.cc
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/cursor_by_account.cc
diff --git a/storage/perfschema/cursor_by_account.h b/storage/perfschema/cursor_by_account.h
index 98321df5751..ac52ada880d 100644
--- a/storage/perfschema/cursor_by_account.h
+++ b/storage/perfschema/cursor_by_account.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef CURSOR_BY_ACCOUNT_H
#define CURSOR_BY_ACCOUNT_H
diff --git a/storage/perfschema/cursor_by_host.cc b/storage/perfschema/cursor_by_host.cc
index f62005511bf..e405bcad7e6 100644
--- a/storage/perfschema/cursor_by_host.cc
+++ b/storage/perfschema/cursor_by_host.cc
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/cursor_by_host.cc
diff --git a/storage/perfschema/cursor_by_host.h b/storage/perfschema/cursor_by_host.h
index 3fbd09e3018..c0db4c5bf0c 100644
--- a/storage/perfschema/cursor_by_host.h
+++ b/storage/perfschema/cursor_by_host.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef CURSOR_BY_HOST_H
#define CURSOR_BY_HOST_H
diff --git a/storage/perfschema/cursor_by_thread.cc b/storage/perfschema/cursor_by_thread.cc
index 06ee2f6cbef..400e4bd238c 100644
--- a/storage/perfschema/cursor_by_thread.cc
+++ b/storage/perfschema/cursor_by_thread.cc
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/cursor_by_thread.cc
diff --git a/storage/perfschema/cursor_by_thread.h b/storage/perfschema/cursor_by_thread.h
index 8f2edef6b7e..a671e0edd42 100644
--- a/storage/perfschema/cursor_by_thread.h
+++ b/storage/perfschema/cursor_by_thread.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef CURSOR_BY_THREAD_H
#define CURSOR_BY_THREAD_H
diff --git a/storage/perfschema/cursor_by_user.cc b/storage/perfschema/cursor_by_user.cc
index 8f8fe99f513..d50a6dde1e2 100644
--- a/storage/perfschema/cursor_by_user.cc
+++ b/storage/perfschema/cursor_by_user.cc
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/cursor_by_user.cc
diff --git a/storage/perfschema/cursor_by_user.h b/storage/perfschema/cursor_by_user.h
index c4f9cabc2dd..c37bb8aa518 100644
--- a/storage/perfschema/cursor_by_user.h
+++ b/storage/perfschema/cursor_by_user.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef CURSOR_BY_USER_H
#define CURSOR_BY_USER_H
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc
index 3f9c9cf6081..285768be49d 100644
--- a/storage/perfschema/ha_perfschema.cc
+++ b/storage/perfschema/ha_perfschema.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2014, 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
@@ -265,7 +265,10 @@ int ha_perfschema::update_row(const uchar *old_data, uchar *new_data)
DBUG_ENTER("ha_perfschema::update_row");
if (!pfs_initialized)
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
-
+
+ if (is_executed_by_slave())
+ DBUG_RETURN(0);
+
DBUG_ASSERT(m_table);
ha_statistic_increment(&SSV::ha_update_count);
int result= m_table->update_row(table, old_data, new_data, table->field);
@@ -318,7 +321,10 @@ int ha_perfschema::rnd_next(uchar *buf)
{
DBUG_ENTER("ha_perfschema::rnd_next");
if (!pfs_initialized)
+ {
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
+ }
DBUG_ASSERT(m_table);
ha_statistic_increment(&SSV::ha_read_rnd_next_count);
@@ -330,6 +336,7 @@ int ha_perfschema::rnd_next(uchar *buf)
if (result == 0)
stats.records++;
}
+ table->status= (result ? STATUS_NOT_FOUND : 0);
DBUG_RETURN(result);
}
@@ -346,13 +353,17 @@ int ha_perfschema::rnd_pos(uchar *buf, uchar *pos)
{
DBUG_ENTER("ha_perfschema::rnd_pos");
if (!pfs_initialized)
+ {
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
+ }
DBUG_ASSERT(m_table);
ha_statistic_increment(&SSV::ha_read_rnd_count);
int result= m_table->rnd_pos(pos);
if (result == 0)
result= m_table->read_row(table, buf, table->field);
+ table->status= (result ? STATUS_NOT_FOUND : 0);
DBUG_RETURN(result);
}
@@ -375,6 +386,9 @@ int ha_perfschema::delete_all_rows(void)
if (!pfs_initialized)
DBUG_RETURN(0);
+ if (is_executed_by_slave())
+ DBUG_RETURN(0);
+
DBUG_ASSERT(m_table_share);
if (m_table_share->m_delete_all_rows)
result= m_table_share->m_delete_all_rows();
diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h
index 8e98341a790..481d663f8e4 100644
--- a/storage/perfschema/ha_perfschema.h
+++ b/storage/perfschema/ha_perfschema.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2014, 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,8 @@
#define HA_PERFSCHEMA_H
#include "handler.h" /* class handler */
+#include "table.h"
+#include "sql_class.h"
/**
@file storage/perfschema/ha_perfschema.h
@@ -199,6 +201,39 @@ public:
virtual void print_error(int error, myf errflags);
private:
+ /**
+ Check if the caller is a replication thread or the caller is called
+ by a client thread executing base64 encoded BINLOG'... statement.
+
+ In theory, performance schema tables are not supposed to be replicated.
+ This is true and enforced starting with MySQL 5.6.10.
+ In practice, in previous versions such as MySQL 5.5 (GA) or earlier 5.6
+ (non GA) DML on performance schema tables could end up written in the binlog,
+ both in STATEMENT and ROW format.
+ While these records are not supposed to be there, they are found when:
+ - performing replication from a 5.5 master to a 5.6 slave during
+ upgrades
+ - performing replication from 5.5 (performance_schema enabled)
+ to a 5.6 slave
+ - performing point in time recovery in 5.6 with old archived logs.
+
+ This API detects when the code calling the performance schema storage
+ engine is a slave thread or whether the code calling isthe client thread
+ executing a BINLOG'.. statement.
+
+ This API acts as a late filter for the above mentioned cases.
+
+ For ROW format, @see Rows_log_event::do_apply_event()
+
+ */
+ bool is_executed_by_slave() const
+ {
+ DBUG_ASSERT(table != NULL);
+ DBUG_ASSERT(table->in_use != NULL);
+ return table->in_use->slave_thread;
+
+ }
+
/** MySQL lock */
THR_LOCK_DATA m_thr_lock;
/** Performance schema table share for this table handler. */
diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc
index 4a0973698ac..876baa47fa6 100644
--- a/storage/perfschema/pfs.cc
+++ b/storage/perfschema/pfs.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2014, 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
@@ -1408,7 +1408,9 @@ static void register_stage_v1(const char *category,
if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH))
{
memcpy(formatted_name + prefix_length, info->m_name, len);
- info->m_key= register_stage_class(formatted_name, full_length,
+ info->m_key= register_stage_class(formatted_name,
+ prefix_length,
+ full_length,
info->m_flags);
}
else
@@ -1706,6 +1708,8 @@ rebind_table_v1(PSI_table_share *share, const void *identity, PSI_table *table)
return NULL;
PFS_thread *thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
+ if (unlikely(thread == NULL))
+ return NULL;
PFS_table *pfs_table= create_table(pfs_table_share, thread, identity);
return reinterpret_cast<PSI_table *> (pfs_table);
@@ -1796,7 +1800,12 @@ static void create_file_v1(PSI_file_key key, const char *name, File file)
*/
struct PFS_spawn_thread_arg
{
- PFS_thread *m_parent_thread;
+ ulonglong m_thread_internal_id;
+ char m_username[USERNAME_LENGTH];
+ uint m_username_length;
+ char m_hostname[HOSTNAME_LENGTH];
+ uint m_hostname_length;
+
PSI_thread_key m_child_key;
const void *m_child_identity;
void *(*m_user_start_routine)(void*);
@@ -1818,17 +1827,15 @@ void* pfs_spawn_thread(void *arg)
pfs= create_thread(klass, typed_arg->m_child_identity, 0);
if (likely(pfs != NULL))
{
- PFS_thread *parent= typed_arg->m_parent_thread;
-
clear_thread_account(pfs);
- pfs->m_parent_thread_internal_id= parent->m_thread_internal_id;
+ pfs->m_parent_thread_internal_id= typed_arg->m_thread_internal_id;
- memcpy(pfs->m_username, parent->m_username, sizeof(pfs->m_username));
- pfs->m_username_length= parent->m_username_length;
+ memcpy(pfs->m_username, typed_arg->m_username, sizeof(pfs->m_username));
+ pfs->m_username_length= typed_arg->m_username_length;
- memcpy(pfs->m_hostname, parent->m_hostname, sizeof(pfs->m_hostname));
- pfs->m_hostname_length= parent->m_hostname_length;
+ memcpy(pfs->m_hostname, typed_arg->m_hostname, sizeof(pfs->m_hostname));
+ pfs->m_hostname_length= typed_arg->m_hostname_length;
set_thread_account(pfs);
}
@@ -1864,6 +1871,7 @@ static int spawn_thread_v1(PSI_thread_key key,
void *(*start_routine)(void*), void *arg)
{
PFS_spawn_thread_arg *psi_arg;
+ PFS_thread *parent;
/* psi_arg can not be global, and can not be a local variable. */
psi_arg= (PFS_spawn_thread_arg*) my_malloc(sizeof(PFS_spawn_thread_arg),
@@ -1871,12 +1879,34 @@ static int spawn_thread_v1(PSI_thread_key key,
if (unlikely(psi_arg == NULL))
return EAGAIN;
- psi_arg->m_parent_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
psi_arg->m_child_key= key;
psi_arg->m_child_identity= (arg ? arg : thread);
psi_arg->m_user_start_routine= start_routine;
psi_arg->m_user_arg= arg;
+ parent= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
+ if (parent != NULL)
+ {
+ /*
+ Make a copy of the parent attributes.
+ This is required, because instrumentation for this thread (the parent)
+ may be destroyed before the child thread instrumentation is created.
+ */
+ psi_arg->m_thread_internal_id= parent->m_thread_internal_id;
+
+ memcpy(psi_arg->m_username, parent->m_username, sizeof(psi_arg->m_username));
+ psi_arg->m_username_length= parent->m_username_length;
+
+ memcpy(psi_arg->m_hostname, parent->m_hostname, sizeof(psi_arg->m_hostname));
+ psi_arg->m_hostname_length= parent->m_hostname_length;
+ }
+ else
+ {
+ psi_arg->m_thread_internal_id= 0;
+ psi_arg->m_username_length= 0;
+ psi_arg->m_hostname_length= 0;
+ }
+
int result= pthread_create(thread, attr, pfs_spawn_thread, psi_arg);
if (unlikely(result != 0))
my_free(psi_arg);
@@ -1939,9 +1969,9 @@ static void set_thread_user_v1(const char *user, int user_len)
if (unlikely(pfs == NULL))
return;
- aggregate_thread(pfs);
+ aggregate_thread(pfs, pfs->m_account, pfs->m_user, pfs->m_host);
- pfs->m_lock.allocated_to_dirty();
+ pfs->m_session_lock.allocated_to_dirty();
clear_thread_account(pfs);
@@ -1971,7 +2001,7 @@ static void set_thread_user_v1(const char *user, int user_len)
pfs->m_enabled= enabled;
- pfs->m_lock.dirty_to_allocated();
+ pfs->m_session_lock.dirty_to_allocated();
}
/**
@@ -1993,7 +2023,7 @@ static void set_thread_account_v1(const char *user, int user_len,
if (unlikely(pfs == NULL))
return;
- pfs->m_lock.allocated_to_dirty();
+ pfs->m_session_lock.allocated_to_dirty();
clear_thread_account(pfs);
@@ -2026,7 +2056,7 @@ static void set_thread_account_v1(const char *user, int user_len,
}
pfs->m_enabled= enabled;
- pfs->m_lock.dirty_to_allocated();
+ pfs->m_session_lock.dirty_to_allocated();
}
/**
@@ -2043,11 +2073,11 @@ static void set_thread_db_v1(const char* db, int db_len)
if (likely(pfs != NULL))
{
- pfs->m_lock.allocated_to_dirty();
+ pfs->m_stmt_lock.allocated_to_dirty();
if (db_len > 0)
memcpy(pfs->m_dbname, db, db_len);
pfs->m_dbname_length= db_len;
- pfs->m_lock.dirty_to_allocated();
+ pfs->m_stmt_lock.dirty_to_allocated();
}
}
@@ -2064,9 +2094,7 @@ static void set_thread_command_v1(int command)
if (likely(pfs != NULL))
{
- pfs->m_lock.allocated_to_dirty();
pfs->m_command= command;
- pfs->m_lock.dirty_to_allocated();
}
}
@@ -2080,9 +2108,7 @@ static void set_thread_start_time_v1(time_t start_time)
if (likely(pfs != NULL))
{
- pfs->m_lock.allocated_to_dirty();
pfs->m_start_time= start_time;
- pfs->m_lock.dirty_to_allocated();
}
}
@@ -2092,24 +2118,14 @@ static void set_thread_start_time_v1(time_t start_time)
*/
static void set_thread_state_v1(const char* state)
{
- PFS_thread *pfs= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
-
- if (likely(pfs != NULL))
- {
- int state_len= state ? strlen(state) : 0;
-
- pfs->m_processlist_lock.allocated_to_dirty();
- pfs->m_processlist_state_ptr= state;
- pfs->m_processlist_state_length= state_len;
- pfs->m_processlist_lock.dirty_to_allocated();
- }
+ /* DEPRECATED. */
}
/**
Implementation of the thread instrumentation interface.
@sa PSI_v1::set_thread_info.
*/
-static void set_thread_info_v1(const char* info, int info_len)
+static void set_thread_info_v1(const char* info, uint info_len)
{
PFS_thread *pfs= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
@@ -2117,10 +2133,22 @@ static void set_thread_info_v1(const char* info, int info_len)
if (likely(pfs != NULL))
{
- pfs->m_processlist_lock.allocated_to_dirty();
- pfs->m_processlist_info_ptr= info;
- pfs->m_processlist_info_length= info_len;
- pfs->m_processlist_lock.dirty_to_allocated();
+ if ((info != NULL) && (info_len > 0))
+ {
+ if (info_len > sizeof(pfs->m_processlist_info))
+ info_len= sizeof(pfs->m_processlist_info);
+
+ pfs->m_stmt_lock.allocated_to_dirty();
+ memcpy(pfs->m_processlist_info, info, info_len);
+ pfs->m_processlist_info_length= info_len;
+ pfs->m_stmt_lock.dirty_to_allocated();
+ }
+ else
+ {
+ pfs->m_stmt_lock.allocated_to_dirty();
+ pfs->m_processlist_info_length= 0;
+ pfs->m_stmt_lock.dirty_to_allocated();
+ }
}
}
@@ -2143,7 +2171,7 @@ static void delete_current_thread_v1(void)
PFS_thread *thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
if (thread != NULL)
{
- aggregate_thread(thread);
+ aggregate_thread(thread, thread->m_account, thread->m_user, thread->m_host);
my_pthread_setspecific_ptr(THR_PFS, NULL);
destroy_thread(thread);
}
@@ -2159,7 +2187,7 @@ static void delete_thread_v1(PSI_thread *thread)
if (pfs != NULL)
{
- aggregate_thread(pfs);
+ aggregate_thread(pfs, pfs->m_account, pfs->m_user, pfs->m_host);
destroy_thread(pfs);
}
}
@@ -3302,6 +3330,8 @@ start_idle_wait_v1(PSI_idle_locker_state* state, const char *src_file, uint src_
state->m_thread= reinterpret_cast<PSI_thread *> (pfs_thread);
flags= STATE_FLAG_THREAD;
+ DBUG_ASSERT(pfs_thread->m_events_statements_count == 0);
+
if (global_idle_class.m_timed)
{
timer_start= get_timer_raw_value_and_function(idle_timer, &state->m_timer);
@@ -4194,13 +4224,16 @@ static void start_stage_v1(PSI_stage_key key, const char *src_file, int src_line
{
ulonglong timer_value= 0;
- if (! flag_global_instrumentation)
- return;
-
PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
if (unlikely(pfs_thread == NULL))
return;
+ /* Always update column threads.processlist_state. */
+ pfs_thread->m_stage= key;
+
+ if (! flag_global_instrumentation)
+ return;
+
if (flag_thread_instrumentation && ! pfs_thread->m_enabled)
return;
@@ -4209,7 +4242,7 @@ static void start_stage_v1(PSI_stage_key key, const char *src_file, int src_line
PFS_events_statements *parent_statement= & pfs_thread->m_statement_stack[0];
PFS_instr_class *old_class= pfs->m_class;
- if (likely(old_class != NULL))
+ if (old_class != NULL)
{
PFS_stage_stat *event_name_array;
event_name_array= pfs_thread->m_instr_class_stages_stats;
@@ -4292,20 +4325,22 @@ static void end_stage_v1()
{
ulonglong timer_value= 0;
- if (! flag_global_instrumentation)
- return;
-
PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
if (unlikely(pfs_thread == NULL))
return;
+ pfs_thread->m_stage= 0;
+
+ if (! flag_global_instrumentation)
+ return;
+
if (flag_thread_instrumentation && ! pfs_thread->m_enabled)
return;
PFS_events_stages *pfs= & pfs_thread->m_stage_current;
PFS_instr_class *old_class= pfs->m_class;
- if (likely(old_class != NULL))
+ if (old_class != NULL)
{
PFS_stage_stat *event_name_array;
event_name_array= pfs_thread->m_instr_class_stages_stats;
@@ -4385,6 +4420,7 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
return NULL;
}
+ pfs_thread->m_stmt_lock.allocated_to_dirty();
PFS_events_statements *pfs= & pfs_thread->m_statement_stack[pfs_thread->m_events_statements_count];
/* m_thread_internal_id is immutable and already set */
DBUG_ASSERT(pfs->m_thread_internal_id == pfs_thread->m_thread_internal_id);
@@ -4435,6 +4471,7 @@ get_thread_statement_locker_v1(PSI_statement_locker_state *state,
flags|= STATE_FLAG_EVENT;
pfs_thread->m_events_statements_count++;
+ pfs_thread->m_stmt_lock.dirty_to_allocated();
}
}
else
@@ -4491,23 +4528,26 @@ refine_statement_v1(PSI_statement_locker *locker,
PFS_statement_class *klass;
/* Only refine statements for mutable instrumentation */
klass= reinterpret_cast<PFS_statement_class*> (state->m_class);
- DBUG_ASSERT(klass->m_flags & PSI_FLAG_MUTABLE);
+ DBUG_ASSERT(klass->is_mutable());
klass= find_statement_class(key);
- if (unlikely(klass == NULL))
- {
- /* FIXME : pop statement stack */
- state->m_discarded= true;
- return NULL;
- }
- if (! klass->m_enabled)
+
+ uint flags= state->m_flags;
+
+ if (unlikely(klass == NULL) || !klass->m_enabled)
{
- /* FIXME : pop statement stack */
+ /* pop statement stack */
+ if (flags & STATE_FLAG_THREAD)
+ {
+ PFS_thread *pfs_thread= reinterpret_cast<PFS_thread *> (state->m_thread);
+ DBUG_ASSERT(pfs_thread != NULL);
+ if (pfs_thread->m_events_statements_count > 0)
+ pfs_thread->m_events_statements_count--;
+ }
+
state->m_discarded= true;
return NULL;
}
- register uint flags= state->m_flags;
-
if ((flags & STATE_FLAG_TIMED) && ! klass->m_timed)
flags= flags & ~STATE_FLAG_TIMED;
@@ -4770,6 +4810,8 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
PFS_events_statements *pfs= reinterpret_cast<PFS_events_statements*> (state->m_statement);
DBUG_ASSERT(pfs != NULL);
+ thread->m_stmt_lock.allocated_to_dirty();
+
switch(da->status())
{
case Diagnostics_area::DA_EMPTY:
@@ -4815,6 +4857,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da)
DBUG_ASSERT(thread->m_events_statements_count > 0);
thread->m_events_statements_count--;
+ thread->m_stmt_lock.dirty_to_allocated();
}
}
else
@@ -5078,22 +5121,22 @@ static int set_thread_connect_attrs_v1(const char *buffer, uint length,
if (likely(thd != NULL) && session_connect_attrs_size_per_thread > 0)
{
+ const CHARSET_INFO *cs = static_cast<const CHARSET_INFO *> (from_cs);
+
/* copy from the input buffer as much as we can fit */
uint copy_size= (uint)(length < session_connect_attrs_size_per_thread ?
length : session_connect_attrs_size_per_thread);
- thd->m_lock.allocated_to_dirty();
+ thd->m_session_lock.allocated_to_dirty();
memcpy(thd->m_session_connect_attrs, buffer, copy_size);
thd->m_session_connect_attrs_length= copy_size;
- thd->m_session_connect_attrs_cs= (const CHARSET_INFO *) from_cs;
- thd->m_lock.dirty_to_allocated();
-
+ thd->m_session_connect_attrs_cs_number= cs->number;
+ thd->m_session_lock.dirty_to_allocated();
+
if (copy_size == length)
return 0;
- else
- {
- session_connect_attrs_lost++;
- return 1;
- }
+
+ session_connect_attrs_lost++;
+ return 1;
}
return 0;
}
diff --git a/storage/perfschema/pfs_account.cc b/storage/perfschema/pfs_account.cc
index d3e58ed90f8..405364a23d3 100644
--- a/storage/perfschema/pfs_account.cc
+++ b/storage/perfschema/pfs_account.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/pfs_account.cc
@@ -319,17 +319,17 @@ search:
return NULL;
}
-void PFS_account::aggregate()
+void PFS_account::aggregate(PFS_user *safe_user, PFS_host *safe_host)
{
- aggregate_waits();
- aggregate_stages();
- aggregate_statements();
- aggregate_stats();
+ aggregate_waits(safe_user, safe_host);
+ aggregate_stages(safe_user, safe_host);
+ aggregate_statements(safe_user, safe_host);
+ aggregate_stats(safe_user, safe_host);
}
-void PFS_account::aggregate_waits()
+void PFS_account::aggregate_waits(PFS_user *safe_user, PFS_host *safe_host)
{
- if (likely(m_user != NULL && m_host != NULL))
+ if (likely(safe_user != NULL && safe_host != NULL))
{
/*
Aggregate EVENTS_WAITS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
@@ -338,30 +338,30 @@ void PFS_account::aggregate_waits()
in parallel.
*/
aggregate_all_event_names(m_instr_class_waits_stats,
- m_user->m_instr_class_waits_stats,
- m_host->m_instr_class_waits_stats);
+ safe_user->m_instr_class_waits_stats,
+ safe_host->m_instr_class_waits_stats);
return;
}
- if (m_user != NULL)
+ if (safe_user != NULL)
{
/*
Aggregate EVENTS_WAITS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
- EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME
*/
aggregate_all_event_names(m_instr_class_waits_stats,
- m_user->m_instr_class_waits_stats);
+ safe_user->m_instr_class_waits_stats);
return;
}
- if (m_host != NULL)
+ if (safe_host != NULL)
{
/*
Aggregate EVENTS_WAITS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
- EVENTS_WAITS_SUMMARY_BY_HOST_BY_EVENT_NAME
*/
aggregate_all_event_names(m_instr_class_waits_stats,
- m_host->m_instr_class_waits_stats);
+ safe_host->m_instr_class_waits_stats);
return;
}
@@ -370,9 +370,9 @@ void PFS_account::aggregate_waits()
return;
}
-void PFS_account::aggregate_stages()
+void PFS_account::aggregate_stages(PFS_user *safe_user, PFS_host *safe_host)
{
- if (likely(m_user != NULL && m_host != NULL))
+ if (likely(safe_user != NULL && safe_host != NULL))
{
/*
Aggregate EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
@@ -381,12 +381,12 @@ void PFS_account::aggregate_stages()
in parallel.
*/
aggregate_all_stages(m_instr_class_stages_stats,
- m_user->m_instr_class_stages_stats,
- m_host->m_instr_class_stages_stats);
+ safe_user->m_instr_class_stages_stats,
+ safe_host->m_instr_class_stages_stats);
return;
}
- if (m_user != NULL)
+ if (safe_user != NULL)
{
/*
Aggregate EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
@@ -395,19 +395,19 @@ void PFS_account::aggregate_stages()
in parallel.
*/
aggregate_all_stages(m_instr_class_stages_stats,
- m_user->m_instr_class_stages_stats,
+ safe_user->m_instr_class_stages_stats,
global_instr_class_stages_array);
return;
}
- if (m_host != NULL)
+ if (safe_host != NULL)
{
/*
Aggregate EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
- EVENTS_STAGES_SUMMARY_BY_HOST_BY_EVENT_NAME
*/
aggregate_all_stages(m_instr_class_stages_stats,
- m_host->m_instr_class_stages_stats);
+ safe_host->m_instr_class_stages_stats);
return;
}
@@ -420,9 +420,9 @@ void PFS_account::aggregate_stages()
return;
}
-void PFS_account::aggregate_statements()
+void PFS_account::aggregate_statements(PFS_user *safe_user, PFS_host *safe_host)
{
- if (likely(m_user != NULL && m_host != NULL))
+ if (likely(safe_user != NULL && safe_host != NULL))
{
/*
Aggregate EVENTS_STATEMENTS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
@@ -431,12 +431,12 @@ void PFS_account::aggregate_statements()
in parallel.
*/
aggregate_all_statements(m_instr_class_statements_stats,
- m_user->m_instr_class_statements_stats,
- m_host->m_instr_class_statements_stats);
+ safe_user->m_instr_class_statements_stats,
+ safe_host->m_instr_class_statements_stats);
return;
}
- if (m_user != NULL)
+ if (safe_user != NULL)
{
/*
Aggregate EVENTS_STATEMENTS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
@@ -445,19 +445,19 @@ void PFS_account::aggregate_statements()
in parallel.
*/
aggregate_all_statements(m_instr_class_statements_stats,
- m_user->m_instr_class_statements_stats,
+ safe_user->m_instr_class_statements_stats,
global_instr_class_statements_array);
return;
}
- if (m_host != NULL)
+ if (safe_host != NULL)
{
/*
Aggregate EVENTS_STATEMENTS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME to:
- EVENTS_STATEMENTS_SUMMARY_BY_HOST_BY_EVENT_NAME
*/
aggregate_all_statements(m_instr_class_statements_stats,
- m_host->m_instr_class_statements_stats);
+ safe_host->m_instr_class_statements_stats);
return;
}
@@ -470,26 +470,26 @@ void PFS_account::aggregate_statements()
return;
}
-void PFS_account::aggregate_stats()
+void PFS_account::aggregate_stats(PFS_user *safe_user, PFS_host *safe_host)
{
- if (likely(m_user != NULL && m_host != NULL))
+ if (likely(safe_user != NULL && safe_host != NULL))
{
- m_user->m_disconnected_count+= m_disconnected_count;
- m_host->m_disconnected_count+= m_disconnected_count;
+ safe_user->m_disconnected_count+= m_disconnected_count;
+ safe_host->m_disconnected_count+= m_disconnected_count;
m_disconnected_count= 0;
return;
}
- if (m_user != NULL)
+ if (safe_user != NULL)
{
- m_user->m_disconnected_count+= m_disconnected_count;
+ safe_user->m_disconnected_count+= m_disconnected_count;
m_disconnected_count= 0;
return;
}
- if (m_host != NULL)
+ if (safe_host != NULL)
{
- m_host->m_disconnected_count+= m_disconnected_count;
+ safe_host->m_disconnected_count+= m_disconnected_count;
m_disconnected_count= 0;
return;
}
@@ -511,9 +511,10 @@ PFS_account *sanitize_account(PFS_account *unsafe)
return NULL;
}
-void purge_account(PFS_thread *thread, PFS_account *account)
+void purge_account(PFS_thread *thread, PFS_account *account,
+ PFS_user *safe_user, PFS_host *safe_host)
{
- account->aggregate();
+ account->aggregate(safe_user, safe_host);
LF_PINS *pins= get_account_hash_pins(thread);
if (unlikely(pins == NULL))
@@ -560,15 +561,19 @@ void purge_all_account(void)
PFS_account *pfs= account_array;
PFS_account *pfs_last= account_array + account_max;
+ PFS_user *user;
+ PFS_host *host;
for ( ; pfs < pfs_last; pfs++)
{
if (pfs->m_lock.is_populated())
{
- pfs->aggregate_stats();
+ user= sanitize_user(pfs->m_user);
+ host= sanitize_host(pfs->m_host);
+ pfs->aggregate_stats(user, host);
if (pfs->get_refcount() == 0)
- purge_account(thread, pfs);
+ purge_account(thread, pfs, user, host);
}
}
}
diff --git a/storage/perfschema/pfs_account.h b/storage/perfschema/pfs_account.h
index 1ac379e0fc9..efd0a424e68 100644
--- a/storage/perfschema/pfs_account.h
+++ b/storage/perfschema/pfs_account.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef PFS_ACCOUNT_H
#define PFS_ACCOUNT_H
@@ -69,11 +69,11 @@ public:
PFS_atomic::add_32(& m_refcount, -1);
}
- void aggregate(void);
- void aggregate_waits(void);
- void aggregate_stages(void);
- void aggregate_statements(void);
- void aggregate_stats(void);
+ void aggregate(PFS_user *safe_user, PFS_host *safe_host);
+ void aggregate_waits(PFS_user *safe_user, PFS_host *safe_host);
+ void aggregate_stages(PFS_user *safe_user, PFS_host *safe_host);
+ void aggregate_statements(PFS_user *safe_user, PFS_host *safe_host);
+ void aggregate_stats(PFS_user *safe_user, PFS_host *safe_host);
void release(void);
/** Internal lock. */
diff --git a/storage/perfschema/pfs_check.cc b/storage/perfschema/pfs_check.cc
index c9c557f3010..97b23c38065 100644
--- a/storage/perfschema/pfs_check.cc
+++ b/storage/perfschema/pfs_check.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -55,9 +55,8 @@ void check_performance_schema()
PFS_engine_table_share::check_all_tables(thd);
+ thd->restore_globals();
delete thd;
- /* Remember that we don't have a THD */
- my_pthread_setspecific_ptr(THR_THD, 0);
DBUG_VOID_RETURN;
}
diff --git a/storage/perfschema/pfs_defaults.cc b/storage/perfschema/pfs_defaults.cc
index 4bd24f59ca8..01cf0d73771 100644
--- a/storage/perfschema/pfs_defaults.cc
+++ b/storage/perfschema/pfs_defaults.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* 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
diff --git a/storage/perfschema/pfs_digest.cc b/storage/perfschema/pfs_digest.cc
index 0d95c0d410e..addfac1f034 100644
--- a/storage/perfschema/pfs_digest.cc
+++ b/storage/perfschema/pfs_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2014, 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
@@ -46,10 +46,10 @@
#define LEX_YYSTYPE YYSTYPE
/**
- Token array :
+ Token array :
Token array is an array of bytes to store tokens recieved during parsing.
Following is the way token array is formed.
-
+
...<non-id-token><non-id-token><id-token><id_len><id_text>...
For Ex:
@@ -64,7 +64,7 @@ ulong digest_lost= 0;
PFS_statements_digest_stat *statements_digest_stat_array= NULL;
/** Consumer flag for table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST. */
bool flag_statements_digest= true;
-/**
+/**
Current index in Stat array where new record is to be inserted.
index 0 is reserved for "all else" case when entire array is full.
*/
@@ -75,7 +75,7 @@ static bool digest_hash_inited= false;
/**
Initialize table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.
- @param digest_sizing
+ @param digest_sizing
*/
int init_digest(const PFS_global_param *param)
{
@@ -232,6 +232,7 @@ search:
{
/* digest_stat array is full. Add stat at index 0 and return. */
pfs= &statements_digest_stat_array[0];
+ digest_lost++;
if (pfs->m_first_seen == 0)
pfs->m_first_seen= now;
@@ -347,7 +348,7 @@ void reset_esms_by_digest()
statements_digest_stat_array[index].reset_data();
}
- /*
+ /*
Reset index which indicates where the next calculated digest information
to be inserted in statements_digest_stat_array.
*/
@@ -362,13 +363,20 @@ void get_digest_text(char* digest_text, PSI_digest_storage* digest_storage)
DBUG_ASSERT(digest_storage != NULL);
bool truncated= false;
int byte_count= digest_storage->m_byte_count;
+ char *digest_output= digest_text;
int bytes_needed= 0;
uint tok= 0;
int current_byte= 0;
lex_token_string *tok_data;
/* -4 is to make sure extra space for '...' and a '\0' at the end. */
int bytes_available= COL_DIGEST_TEXT_SIZE - 4;
-
+
+ if (byte_count <= 0 || byte_count > PSI_MAX_DIGEST_STORAGE_SIZE)
+ {
+ *digest_text= '\0';
+ return;
+ }
+
/* Convert text to utf8 */
const CHARSET_INFO *from_cs= get_charset(digest_storage->m_charset_number, MYF(0));
const CHARSET_INFO *to_cs= &my_charset_utf8_bin;
@@ -400,8 +408,15 @@ void get_digest_text(char* digest_text, PSI_digest_storage* digest_storage)
!truncated)
{
current_byte= read_token(digest_storage, current_byte, &tok);
+
+ if (tok <= 0 || tok >= array_elements(lex_token_array))
+ {
+ *digest_text='\0';
+ return;
+ }
+
tok_data= &lex_token_array[tok];
-
+
switch (tok)
{
/* All identifiers are printed with their name. */
@@ -440,19 +455,19 @@ void get_digest_text(char* digest_text, PSI_digest_storage* digest_storage)
break;
}
/* Copy the converted identifier into the digest string. */
- bytes_needed= id_length + (tok == IDENT ? 1 : 3);
+ bytes_needed= id_length + (tok == IDENT ? 1 : 3);
if (bytes_needed <= bytes_available)
{
if (tok == IDENT_QUOTED)
- *digest_text++= '`';
+ *digest_output++= '`';
if (id_length > 0)
{
- memcpy(digest_text, id_string, id_length);
- digest_text+= id_length;
+ memcpy(digest_output, id_string, id_length);
+ digest_output+= id_length;
}
if (tok == IDENT_QUOTED)
- *digest_text++= '`';
- *digest_text++= ' ';
+ *digest_output++= '`';
+ *digest_output++= ' ';
bytes_available-= bytes_needed;
}
else
@@ -464,7 +479,7 @@ void get_digest_text(char* digest_text, PSI_digest_storage* digest_storage)
/* Everything else is printed as is. */
default:
- /*
+ /*
Make sure not to overflow digest_text buffer.
+1 is to make sure extra space for ' '.
*/
@@ -473,9 +488,9 @@ void get_digest_text(char* digest_text, PSI_digest_storage* digest_storage)
if (bytes_needed <= bytes_available)
{
- strncpy(digest_text, tok_data->m_token_string, tok_length);
- digest_text+= tok_length;
- *digest_text++= ' ';
+ strncpy(digest_output, tok_data->m_token_string, tok_length);
+ digest_output+= tok_length;
+ *digest_output++= ' ';
bytes_available-= bytes_needed;
}
else
@@ -489,11 +504,11 @@ void get_digest_text(char* digest_text, PSI_digest_storage* digest_storage)
/* Truncate digest text in case of long queries. */
if (digest_storage->m_full || truncated)
{
- strcpy(digest_text, "...");
- digest_text+= 3;
+ strcpy(digest_output, "...");
+ digest_output+= 3;
}
- *digest_text= '\0';
+ *digest_output= '\0';
}
static inline uint peek_token(const PSI_digest_storage *digest, int index)
@@ -509,30 +524,33 @@ static inline uint peek_token(const PSI_digest_storage *digest, int index)
/**
Function to read last two tokens from token array. If an identifier
- is found, do not look for token after that.
+ is found, do not look for token before that.
*/
static inline void peek_last_two_tokens(const PSI_digest_storage* digest_storage,
int last_id_index, uint *t1, uint *t2)
{
int byte_count= digest_storage->m_byte_count;
+ int peek_index= byte_count - PFS_SIZE_OF_A_TOKEN;
- if (last_id_index <= byte_count - PFS_SIZE_OF_A_TOKEN)
+ if (last_id_index <= peek_index)
{
/* Take last token. */
- *t1= peek_token(digest_storage, byte_count - PFS_SIZE_OF_A_TOKEN);
- }
- else
- {
- *t1= TOK_PFS_UNUSED;
- }
+ *t1= peek_token(digest_storage, peek_index);
- if (last_id_index <= byte_count - 2*PFS_SIZE_OF_A_TOKEN)
- {
- /* Take 2nd token from last. */
- *t2= peek_token(digest_storage, byte_count - 2 * PFS_SIZE_OF_A_TOKEN);
+ peek_index-= PFS_SIZE_OF_A_TOKEN;
+ if (last_id_index <= peek_index)
+ {
+ /* Take 2nd token from last. */
+ *t2= peek_token(digest_storage, peek_index);
+ }
+ else
+ {
+ *t2= TOK_PFS_UNUSED;
+ }
}
else
{
+ *t1= TOK_PFS_UNUSED;
*t2= TOK_PFS_UNUSED;
}
}
@@ -575,15 +593,12 @@ PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker,
if (digest_storage->m_full || token == END_OF_INPUT)
return NULL;
- /*
+ /*
Take last_token 2 tokens collected till now. These tokens will be used
in reduce for normalisation. Make sure not to consider ID tokens in reduce.
*/
uint last_token;
uint last_token2;
-
- peek_last_two_tokens(digest_storage, state->m_last_id_index,
- &last_token, &last_token2);
switch (token)
{
@@ -607,6 +622,9 @@ PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker,
/* fall through */
case NULL_SYM:
{
+ peek_last_two_tokens(digest_storage, state->m_last_id_index,
+ &last_token, &last_token2);
+
if ((last_token2 == TOK_PFS_GENERIC_VALUE ||
last_token2 == TOK_PFS_GENERIC_VALUE_LIST ||
last_token2 == NULL_SYM) &&
@@ -616,7 +634,7 @@ PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker,
REDUCE:
TOK_PFS_GENERIC_VALUE_LIST :=
(TOK_PFS_GENERIC_VALUE|NULL_SYM) ',' (TOK_PFS_GENERIC_VALUE|NULL_SYM)
-
+
REDUCE:
TOK_PFS_GENERIC_VALUE_LIST :=
TOK_PFS_GENERIC_VALUE_LIST ',' (TOK_PFS_GENERIC_VALUE|NULL_SYM)
@@ -632,17 +650,20 @@ PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker,
}
case ')':
{
+ peek_last_two_tokens(digest_storage, state->m_last_id_index,
+ &last_token, &last_token2);
+
if (last_token == TOK_PFS_GENERIC_VALUE &&
- last_token2 == '(')
- {
+ last_token2 == '(')
+ {
/*
REDUCE:
TOK_PFS_ROW_SINGLE_VALUE :=
- '(' TOK_PFS_GENERIC_VALUE ')'
+ '(' TOK_PFS_GENERIC_VALUE ')'
*/
digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
token= TOK_PFS_ROW_SINGLE_VALUE;
-
+
/* Read last two tokens again */
peek_last_two_tokens(digest_storage, state->m_last_id_index,
&last_token, &last_token2);
@@ -653,11 +674,11 @@ PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker,
{
/*
REDUCE:
- TOK_PFS_ROW_SINGLE_VALUE_LIST :=
+ TOK_PFS_ROW_SINGLE_VALUE_LIST :=
TOK_PFS_ROW_SINGLE_VALUE ',' TOK_PFS_ROW_SINGLE_VALUE
REDUCE:
- TOK_PFS_ROW_SINGLE_VALUE_LIST :=
+ TOK_PFS_ROW_SINGLE_VALUE_LIST :=
TOK_PFS_ROW_SINGLE_VALUE_LIST ',' TOK_PFS_ROW_SINGLE_VALUE
*/
digest_storage->m_byte_count-= 2*PFS_SIZE_OF_A_TOKEN;
@@ -665,7 +686,7 @@ PSI_digest_locker* pfs_digest_add_token_v1(PSI_digest_locker *locker,
}
}
else if (last_token == TOK_PFS_GENERIC_VALUE_LIST &&
- last_token2 == '(')
+ last_token2 == '(')
{
/*
REDUCE:
diff --git a/storage/perfschema/pfs_digest.h b/storage/perfschema/pfs_digest.h
index d2453dc32c6..03f534b3d7e 100644
--- a/storage/perfschema/pfs_digest.h
+++ b/storage/perfschema/pfs_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -123,10 +123,10 @@ static inline void digest_copy(PSI_digest_storage *to, const PSI_digest_storage
inline int read_token(PSI_digest_storage *digest_storage,
int index, uint *tok)
{
- DBUG_ASSERT(index <= digest_storage->m_byte_count);
- DBUG_ASSERT(digest_storage->m_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE);
+ int safe_byte_count= digest_storage->m_byte_count;
- if (index + PFS_SIZE_OF_A_TOKEN <= digest_storage->m_byte_count)
+ if (index + PFS_SIZE_OF_A_TOKEN <= safe_byte_count &&
+ safe_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE)
{
unsigned char *src= & digest_storage->m_token_array[index];
*tok= src[0] | (src[1] << 8);
diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc
index 789047f4d11..df4418b4bae 100644
--- a/storage/perfschema/pfs_engine_table.cc
+++ b/storage/perfschema/pfs_engine_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -723,7 +723,7 @@ bool pfs_show_status(handlerton *hton, THD *thd,
uint buflen;
const char *name;
int i;
- uint size;
+ size_t size;
DBUG_ENTER("pfs_show_status");
@@ -737,7 +737,7 @@ bool pfs_show_status(handlerton *hton, THD *thd,
if (stat != HA_ENGINE_STATUS)
DBUG_RETURN(false);
- uint total_memory= 0;
+ size_t total_memory= 0;
for (i=0; /* empty */; i++)
{
@@ -1431,7 +1431,7 @@ bool pfs_show_status(handlerton *hton, THD *thd,
break;
}
- buflen= int10_to_str(size, buf, 10) - buf;
+ buflen= longlong10_to_str(size, buf, 10) - buf;
if (print(thd,
PERFORMANCE_SCHEMA_str.str, PERFORMANCE_SCHEMA_str.length,
name, strlen(name),
diff --git a/storage/perfschema/pfs_events_stages.cc b/storage/perfschema/pfs_events_stages.cc
index dbdfa6068ed..282071f830e 100644
--- a/storage/perfschema/pfs_events_stages.cc
+++ b/storage/perfschema/pfs_events_stages.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -179,11 +179,19 @@ void reset_events_stages_by_thread()
{
PFS_thread *thread= thread_array;
PFS_thread *thread_last= thread_array + thread_max;
+ PFS_account *account;
+ PFS_user *user;
+ PFS_host *host;
for ( ; thread < thread_last; thread++)
{
if (thread->m_lock.is_populated())
- aggregate_thread_stages(thread);
+ {
+ account= sanitize_account(thread->m_account);
+ user= sanitize_user(thread->m_user);
+ host= sanitize_host(thread->m_host);
+ aggregate_thread_stages(thread, account, user, host);
+ }
}
}
@@ -192,11 +200,17 @@ void reset_events_stages_by_account()
{
PFS_account *pfs= account_array;
PFS_account *pfs_last= account_array + account_max;
+ PFS_user *user;
+ PFS_host *host;
for ( ; pfs < pfs_last; pfs++)
{
if (pfs->m_lock.is_populated())
- pfs->aggregate_stages();
+ {
+ user= sanitize_user(pfs->m_user);
+ host= sanitize_host(pfs->m_host);
+ pfs->aggregate_stages(user, host);
+ }
}
}
diff --git a/storage/perfschema/pfs_events_statements.cc b/storage/perfschema/pfs_events_statements.cc
index 66def924d80..07810d26dc4 100644
--- a/storage/perfschema/pfs_events_statements.cc
+++ b/storage/perfschema/pfs_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -183,11 +183,19 @@ void reset_events_statements_by_thread()
{
PFS_thread *thread= thread_array;
PFS_thread *thread_last= thread_array + thread_max;
+ PFS_account *account;
+ PFS_user *user;
+ PFS_host *host;
for ( ; thread < thread_last; thread++)
{
if (thread->m_lock.is_populated())
- aggregate_thread_statements(thread);
+ {
+ account= sanitize_account(thread->m_account);
+ user= sanitize_user(thread->m_user);
+ host= sanitize_host(thread->m_host);
+ aggregate_thread_statements(thread, account, user, host);
+ }
}
}
@@ -196,11 +204,17 @@ void reset_events_statements_by_account()
{
PFS_account *pfs= account_array;
PFS_account *pfs_last= account_array + account_max;
+ PFS_user *user;
+ PFS_host *host;
for ( ; pfs < pfs_last; pfs++)
{
if (pfs->m_lock.is_populated())
- pfs->aggregate_statements();
+ {
+ user= sanitize_user(pfs->m_user);
+ host= sanitize_host(pfs->m_host);
+ pfs->aggregate_statements(user, host);
+ }
}
}
diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc
index c8a9d20a2f1..2799550c81d 100644
--- a/storage/perfschema/pfs_events_waits.cc
+++ b/storage/perfschema/pfs_events_waits.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -183,11 +183,19 @@ void reset_events_waits_by_thread()
{
PFS_thread *thread= thread_array;
PFS_thread *thread_last= thread_array + thread_max;
+ PFS_account *account;
+ PFS_user *user;
+ PFS_host *host;
for ( ; thread < thread_last; thread++)
{
if (thread->m_lock.is_populated())
- aggregate_thread_waits(thread);
+ {
+ account= sanitize_account(thread->m_account);
+ user= sanitize_user(thread->m_user);
+ host= sanitize_host(thread->m_host);
+ aggregate_thread_waits(thread, account, user, host);
+ }
}
}
@@ -196,11 +204,17 @@ void reset_events_waits_by_account()
{
PFS_account *pfs= account_array;
PFS_account *pfs_last= account_array + account_max;
+ PFS_user *user;
+ PFS_host *host;
for ( ; pfs < pfs_last; pfs++)
{
if (pfs->m_lock.is_populated())
- pfs->aggregate_waits();
+ {
+ user= sanitize_user(pfs->m_user);
+ host= sanitize_host(pfs->m_host);
+ pfs->aggregate_waits(user, host);
+ }
}
}
diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc
index d0dc26b1bf4..a82ffe58cea 100644
--- a/storage/perfschema/pfs_global.cc
+++ b/storage/perfschema/pfs_global.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -37,7 +37,7 @@
#endif
bool pfs_initialized= false;
-ulonglong pfs_allocated_memory= 0;
+size_t pfs_allocated_memory= 0;
/**
Memory allocation for the performance schema.
diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h
index cddf688ddf4..2ec76df6f91 100644
--- a/storage/perfschema/pfs_global.h
+++ b/storage/perfschema/pfs_global.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
/** True when the performance schema is initialized. */
extern bool pfs_initialized;
/** Total memory allocated by the performance schema, in bytes. */
-extern ulonglong pfs_allocated_memory;
+extern size_t pfs_allocated_memory;
#if defined(HAVE_POSIX_MEMALIGN) || defined(HAVE_MEMALIGN) || defined(HAVE_ALIGNED_MALLOC)
#define PFS_ALIGNEMENT 64
diff --git a/storage/perfschema/pfs_host.cc b/storage/perfschema/pfs_host.cc
index 735480b53db..0c6f5cf3627 100644
--- a/storage/perfschema/pfs_host.cc
+++ b/storage/perfschema/pfs_host.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/pfs_host.cc
@@ -333,6 +333,14 @@ void PFS_host::release()
dec_refcount();
}
+PFS_host *sanitize_host(PFS_host *unsafe)
+{
+ if ((&host_array[0] <= unsafe) &&
+ (unsafe < &host_array[host_max]))
+ return unsafe;
+ return NULL;
+}
+
void purge_host(PFS_thread *thread, PFS_host *host)
{
LF_PINS *pins= get_host_hash_pins(thread);
diff --git a/storage/perfschema/pfs_host.h b/storage/perfschema/pfs_host.h
index eb0ff6efc6f..9c039cf919f 100644
--- a/storage/perfschema/pfs_host.h
+++ b/storage/perfschema/pfs_host.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef PFS_HOST_H
#define PFS_HOST_H
@@ -94,6 +94,7 @@ void cleanup_host_hash(void);
PFS_host *find_or_create_host(PFS_thread *thread,
const char *hostname, uint hostname_length);
+PFS_host *sanitize_host(PFS_host *unsafe);
void purge_all_host(void);
/* For iterators and show status. */
diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc
index 335f85bd45e..cf0e6fd56f8 100644
--- a/storage/perfschema/pfs_instr.cc
+++ b/storage/perfschema/pfs_instr.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -38,22 +38,32 @@
/** Size of the mutex instances array. @sa mutex_array */
ulong mutex_max;
+/** True when @c mutex_array is full. */
+bool mutex_full;
/** Number of mutexes instance lost. @sa mutex_array */
ulong mutex_lost;
/** Size of the rwlock instances array. @sa rwlock_array */
ulong rwlock_max;
+/** True when @c rwlock_array is full. */
+bool rwlock_full;
/** Number or rwlock instances lost. @sa rwlock_array */
ulong rwlock_lost;
/** Size of the conditions instances array. @sa cond_array */
ulong cond_max;
+/** True when @c cond_array is full. */
+bool cond_full;
/** Number of conditions instances lost. @sa cond_array */
ulong cond_lost;
/** Size of the thread instances array. @sa thread_array */
ulong thread_max;
+/** True when @c thread_array is full. */
+bool thread_full;
/** Number or thread instances lost. @sa thread_array */
ulong thread_lost;
/** Size of the file instances array. @sa file_array */
ulong file_max;
+/** True when @c file_array is full. */
+bool file_full;
/** Number of file instances lost. @sa file_array */
ulong file_lost;
/**
@@ -61,14 +71,20 @@ ulong file_lost;
Signed value, for easier comparisons with a file descriptor number.
*/
long file_handle_max;
+/** True when @c file_handle_array is full. */
+bool file_handle_full;
/** Number of file handle lost. @sa file_handle_array */
ulong file_handle_lost;
/** Size of the table instances array. @sa table_array */
ulong table_max;
+/** True when @c table_array is full. */
+bool table_full;
/** Number of table instances lost. @sa table_array */
ulong table_lost;
/** Size of the socket instances array. @sa socket_array */
ulong socket_max;
+/** True when @c socket_array is full. */
+bool socket_full;
/** Number of socket instances lost. @sa socket_array */
ulong socket_lost;
/** Number of EVENTS_WAITS_HISTORY records per thread. */
@@ -185,20 +201,28 @@ int init_instruments(const PFS_global_param *param)
DBUG_ASSERT(wait_class_max != 0);
mutex_max= param->m_mutex_sizing;
+ mutex_full= false;
mutex_lost= 0;
rwlock_max= param->m_rwlock_sizing;
+ rwlock_full= false;
rwlock_lost= 0;
cond_max= param->m_cond_sizing;
+ cond_full= false;
cond_lost= 0;
file_max= param->m_file_sizing;
+ file_full= false;
file_lost= 0;
file_handle_max= param->m_file_handle_sizing;
+ file_handle_full= false;
file_handle_lost= 0;
table_max= param->m_table_sizing;
+ table_full= false;
table_lost= 0;
thread_max= param->m_thread_sizing;
+ thread_full= false;
thread_lost= 0;
socket_max= param->m_socket_sizing;
+ socket_full= false;
socket_lost= 0;
events_waits_history_per_thread= param->m_events_waits_history_sizing;
@@ -601,6 +625,17 @@ PFS_mutex* create_mutex(PFS_mutex_class *klass, const void *identity)
uint attempts= 0;
PFS_mutex *pfs;
+ if (mutex_full)
+ {
+ /*
+ This is a safety plug.
+ When mutex_array is severely undersized,
+ do not spin to death for each call.
+ */
+ mutex_lost++;
+ return NULL;
+ }
+
while (++attempts <= mutex_max)
{
/*
@@ -645,6 +680,15 @@ PFS_mutex* create_mutex(PFS_mutex_class *klass, const void *identity)
}
mutex_lost++;
+ /*
+ Race condition.
+ The mutex_array might not be full if a concurrent thread
+ called destroy_mutex() during the scan, leaving one
+ empty slot we did not find.
+ However, 99.999 percent full tables or 100 percent full tables
+ are treated the same here, we declare the array overloaded.
+ */
+ mutex_full= true;
return NULL;
}
@@ -662,6 +706,7 @@ void destroy_mutex(PFS_mutex *pfs)
if (klass->is_singleton())
klass->m_singleton= NULL;
pfs->m_lock.allocated_to_free();
+ mutex_full= false;
}
/**
@@ -677,6 +722,12 @@ PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity)
uint attempts= 0;
PFS_rwlock *pfs;
+ if (rwlock_full)
+ {
+ rwlock_lost++;
+ return NULL;
+ }
+
while (++attempts <= rwlock_max)
{
/* See create_mutex() */
@@ -705,6 +756,7 @@ PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity)
}
rwlock_lost++;
+ rwlock_full= true;
return NULL;
}
@@ -722,6 +774,7 @@ void destroy_rwlock(PFS_rwlock *pfs)
if (klass->is_singleton())
klass->m_singleton= NULL;
pfs->m_lock.allocated_to_free();
+ rwlock_full= false;
}
/**
@@ -737,6 +790,12 @@ PFS_cond* create_cond(PFS_cond_class *klass, const void *identity)
uint attempts= 0;
PFS_cond *pfs;
+ if (cond_full)
+ {
+ cond_lost++;
+ return NULL;
+ }
+
while (++attempts <= cond_max)
{
/* See create_mutex() */
@@ -763,6 +822,7 @@ PFS_cond* create_cond(PFS_cond_class *klass, const void *identity)
}
cond_lost++;
+ cond_full= true;
return NULL;
}
@@ -780,6 +840,7 @@ void destroy_cond(PFS_cond *pfs)
if (klass->is_singleton())
klass->m_singleton= NULL;
pfs->m_lock.allocated_to_free();
+ cond_full= false;
}
PFS_thread* PFS_thread::get_current_thread()
@@ -791,7 +852,7 @@ PFS_thread* PFS_thread::get_current_thread()
void PFS_thread::reset_session_connect_attrs()
{
m_session_connect_attrs_length= 0;
- m_session_connect_attrs_cs= NULL;
+ m_session_connect_attrs_cs_number= 0;
if ((m_session_connect_attrs != NULL) &&
(session_connect_attrs_size_per_thread > 0) )
@@ -818,6 +879,12 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity,
uint attempts= 0;
PFS_thread *pfs;
+ if (thread_full)
+ {
+ thread_lost++;
+ return NULL;
+ }
+
while (++attempts <= thread_max)
{
/* See create_mutex() */
@@ -833,6 +900,8 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity,
pfs->m_parent_thread_internal_id= 0;
pfs->m_processlist_id= processlist_id;
pfs->m_event_id= 1;
+ pfs->m_stmt_lock.set_allocated();
+ pfs->m_session_lock.set_allocated();
pfs->m_enabled= true;
pfs->m_class= klass;
pfs->m_events_waits_current= & pfs->m_events_waits_stack[WAIT_STACK_BOTTOM];
@@ -860,11 +929,9 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity,
pfs->m_dbname_length= 0;
pfs->m_command= 0;
pfs->m_start_time= 0;
- pfs->m_processlist_state_ptr= NULL;
- pfs->m_processlist_state_length= 0;
- pfs->m_processlist_info_ptr= NULL;
+ pfs->m_stage= 0;
+ pfs->m_processlist_info[0]= '\0';
pfs->m_processlist_info_length= 0;
- pfs->m_processlist_lock.set_allocated();
pfs->m_host= NULL;
pfs->m_user= NULL;
@@ -942,6 +1009,7 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity,
}
thread_lost++;
+ thread_full= true;
return NULL;
}
@@ -1053,6 +1121,7 @@ void destroy_thread(PFS_thread *pfs)
pfs->m_digest_hash_pins= NULL;
}
pfs->m_lock.allocated_to_free();
+ thread_full= false;
}
/**
@@ -1203,6 +1272,12 @@ search:
return NULL;
}
+ if (file_full)
+ {
+ file_lost++;
+ return NULL;
+ }
+
while (++attempts <= file_max)
{
/* See create_mutex() */
@@ -1256,6 +1331,7 @@ search:
}
file_lost++;
+ file_full= true;
return NULL;
}
@@ -1295,6 +1371,7 @@ void destroy_file(PFS_thread *thread, PFS_file *pfs)
if (klass->is_singleton())
klass->m_singleton= NULL;
pfs->m_lock.allocated_to_free();
+ file_full= false;
}
/**
@@ -1312,6 +1389,12 @@ PFS_table* create_table(PFS_table_share *share, PFS_thread *opening_thread,
uint attempts= 0;
PFS_table *pfs;
+ if (table_full)
+ {
+ table_lost++;
+ return NULL;
+ }
+
while (++attempts <= table_max)
{
/* See create_mutex() */
@@ -1342,6 +1425,7 @@ PFS_table* create_table(PFS_table_share *share, PFS_thread *opening_thread,
}
table_lost++;
+ table_full= true;
return NULL;
}
@@ -1439,6 +1523,7 @@ void destroy_table(PFS_table *pfs)
DBUG_ASSERT(pfs != NULL);
pfs->m_share->dec_refcount();
pfs->m_lock.allocated_to_free();
+ table_full= false;
}
/**
@@ -1455,6 +1540,12 @@ PFS_socket* create_socket(PFS_socket_class *klass, const my_socket *fd,
uint attempts= 0;
PFS_socket *pfs;
+ if (socket_full)
+ {
+ socket_lost++;
+ return NULL;
+ }
+
uint fd_used= 0;
uint addr_len_used= addr_len;
@@ -1504,6 +1595,7 @@ PFS_socket* create_socket(PFS_socket_class *klass, const my_socket *fd,
}
socket_lost++;
+ socket_full= true;
return NULL;
}
@@ -1541,6 +1633,7 @@ void destroy_socket(PFS_socket *pfs)
pfs->m_fd= 0;
pfs->m_addr_len= 0;
pfs->m_lock.allocated_to_free();
+ socket_full= false;
}
static void reset_mutex_waits_by_instance(void)
@@ -1756,55 +1849,57 @@ void aggregate_all_statements(PFS_statement_stat *from_array,
}
}
-void aggregate_thread_stats(PFS_thread *thread)
+void aggregate_thread_stats(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host)
{
- if (likely(thread->m_account != NULL))
+ if (likely(safe_account != NULL))
{
- thread->m_account->m_disconnected_count++;
+ safe_account->m_disconnected_count++;
return;
}
- if (thread->m_user != NULL)
- thread->m_user->m_disconnected_count++;
+ if (safe_user != NULL)
+ safe_user->m_disconnected_count++;
- if (thread->m_host != NULL)
- thread->m_host->m_disconnected_count++;
+ if (safe_host != NULL)
+ safe_host->m_disconnected_count++;
/* There is no global table for connections statistics. */
return;
}
-void aggregate_thread(PFS_thread *thread)
+void aggregate_thread(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host)
{
- aggregate_thread_waits(thread);
- aggregate_thread_stages(thread);
- aggregate_thread_statements(thread);
- aggregate_thread_stats(thread);
+ aggregate_thread_waits(thread, safe_account, safe_user, safe_host);
+ aggregate_thread_stages(thread, safe_account, safe_user, safe_host);
+ aggregate_thread_statements(thread, safe_account, safe_user, safe_host);
+ aggregate_thread_stats(thread, safe_account, safe_user, safe_host);
}
-void aggregate_thread_waits(PFS_thread *thread)
+void aggregate_thread_waits(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host)
{
- if (likely(thread->m_account != NULL))
+ if (likely(safe_account != NULL))
{
- DBUG_ASSERT(thread->m_user == NULL);
- DBUG_ASSERT(thread->m_host == NULL);
- DBUG_ASSERT(thread->m_account->get_refcount() > 0);
-
/*
Aggregate EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
to EVENTS_WAITS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME.
*/
aggregate_all_event_names(thread->m_instr_class_waits_stats,
- thread->m_account->m_instr_class_waits_stats);
+ safe_account->m_instr_class_waits_stats);
return;
}
- if ((thread->m_user != NULL) && (thread->m_host != NULL))
+ if ((safe_user != NULL) && (safe_host != NULL))
{
- DBUG_ASSERT(thread->m_user->get_refcount() > 0);
- DBUG_ASSERT(thread->m_host->get_refcount() > 0);
-
/*
Aggregate EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME to:
- EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME
@@ -1812,34 +1907,30 @@ void aggregate_thread_waits(PFS_thread *thread)
in parallel.
*/
aggregate_all_event_names(thread->m_instr_class_waits_stats,
- thread->m_user->m_instr_class_waits_stats,
- thread->m_host->m_instr_class_waits_stats);
+ safe_user->m_instr_class_waits_stats,
+ safe_host->m_instr_class_waits_stats);
return;
}
- if (thread->m_user != NULL)
+ if (safe_user != NULL)
{
- DBUG_ASSERT(thread->m_user->get_refcount() > 0);
-
/*
Aggregate EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
to EVENTS_WAITS_SUMMARY_BY_USER_BY_EVENT_NAME, directly.
*/
aggregate_all_event_names(thread->m_instr_class_waits_stats,
- thread->m_user->m_instr_class_waits_stats);
+ safe_user->m_instr_class_waits_stats);
return;
}
- if (thread->m_host != NULL)
+ if (safe_host != NULL)
{
- DBUG_ASSERT(thread->m_host->get_refcount() > 0);
-
/*
Aggregate EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
to EVENTS_WAITS_SUMMARY_BY_HOST_BY_EVENT_NAME, directly.
*/
aggregate_all_event_names(thread->m_instr_class_waits_stats,
- thread->m_host->m_instr_class_waits_stats);
+ safe_host->m_instr_class_waits_stats);
return;
}
@@ -1847,29 +1938,25 @@ void aggregate_thread_waits(PFS_thread *thread)
thread->reset_waits_stats();
}
-void aggregate_thread_stages(PFS_thread *thread)
+void aggregate_thread_stages(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host)
{
- if (likely(thread->m_account != NULL))
+ if (likely(safe_account != NULL))
{
- DBUG_ASSERT(thread->m_user == NULL);
- DBUG_ASSERT(thread->m_host == NULL);
- DBUG_ASSERT(thread->m_account->get_refcount() > 0);
-
/*
Aggregate EVENTS_STAGES_SUMMARY_BY_THREAD_BY_EVENT_NAME
to EVENTS_STAGES_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME.
*/
aggregate_all_stages(thread->m_instr_class_stages_stats,
- thread->m_account->m_instr_class_stages_stats);
+ safe_account->m_instr_class_stages_stats);
return;
}
- if ((thread->m_user != NULL) && (thread->m_host != NULL))
+ if ((safe_user != NULL) && (safe_host != NULL))
{
- DBUG_ASSERT(thread->m_user->get_refcount() > 0);
- DBUG_ASSERT(thread->m_host->get_refcount() > 0);
-
/*
Aggregate EVENTS_STAGES_SUMMARY_BY_THREAD_BY_EVENT_NAME to:
- EVENTS_STAGES_SUMMARY_BY_USER_BY_EVENT_NAME
@@ -1877,15 +1964,13 @@ void aggregate_thread_stages(PFS_thread *thread)
in parallel.
*/
aggregate_all_stages(thread->m_instr_class_stages_stats,
- thread->m_user->m_instr_class_stages_stats,
- thread->m_host->m_instr_class_stages_stats);
+ safe_user->m_instr_class_stages_stats,
+ safe_host->m_instr_class_stages_stats);
return;
}
- if (thread->m_user != NULL)
+ if (safe_user != NULL)
{
- DBUG_ASSERT(thread->m_user->get_refcount() > 0);
-
/*
Aggregate EVENTS_STAGES_SUMMARY_BY_THREAD_BY_EVENT_NAME to:
- EVENTS_STAGES_SUMMARY_BY_USER_BY_EVENT_NAME
@@ -1893,21 +1978,19 @@ void aggregate_thread_stages(PFS_thread *thread)
in parallel.
*/
aggregate_all_stages(thread->m_instr_class_stages_stats,
- thread->m_user->m_instr_class_stages_stats,
+ safe_user->m_instr_class_stages_stats,
global_instr_class_stages_array);
return;
}
- if (thread->m_host != NULL)
+ if (safe_host != NULL)
{
- DBUG_ASSERT(thread->m_host->get_refcount() > 0);
-
/*
Aggregate EVENTS_STAGES_SUMMARY_BY_THREAD_BY_EVENT_NAME
to EVENTS_STAGES_SUMMARY_BY_HOST_BY_EVENT_NAME, directly.
*/
aggregate_all_stages(thread->m_instr_class_stages_stats,
- thread->m_host->m_instr_class_stages_stats);
+ safe_host->m_instr_class_stages_stats);
return;
}
@@ -1919,29 +2002,25 @@ void aggregate_thread_stages(PFS_thread *thread)
global_instr_class_stages_array);
}
-void aggregate_thread_statements(PFS_thread *thread)
+void aggregate_thread_statements(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host)
{
- if (likely(thread->m_account != NULL))
+ if (likely(safe_account != NULL))
{
- DBUG_ASSERT(thread->m_user == NULL);
- DBUG_ASSERT(thread->m_host == NULL);
- DBUG_ASSERT(thread->m_account->get_refcount() > 0);
-
/*
Aggregate EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME
to EVENTS_STATEMENTS_SUMMARY_BY_ACCOUNT_BY_EVENT_NAME.
*/
aggregate_all_statements(thread->m_instr_class_statements_stats,
- thread->m_account->m_instr_class_statements_stats);
+ safe_account->m_instr_class_statements_stats);
return;
}
- if ((thread->m_user != NULL) && (thread->m_host != NULL))
+ if ((safe_user != NULL) && (safe_host != NULL))
{
- DBUG_ASSERT(thread->m_user->get_refcount() > 0);
- DBUG_ASSERT(thread->m_host->get_refcount() > 0);
-
/*
Aggregate EVENTS_STATEMENT_SUMMARY_BY_THREAD_BY_EVENT_NAME to:
- EVENTS_STATEMENT_SUMMARY_BY_USER_BY_EVENT_NAME
@@ -1949,15 +2028,13 @@ void aggregate_thread_statements(PFS_thread *thread)
in parallel.
*/
aggregate_all_statements(thread->m_instr_class_statements_stats,
- thread->m_user->m_instr_class_statements_stats,
- thread->m_host->m_instr_class_statements_stats);
+ safe_user->m_instr_class_statements_stats,
+ safe_host->m_instr_class_statements_stats);
return;
}
- if (thread->m_user != NULL)
+ if (safe_user != NULL)
{
- DBUG_ASSERT(thread->m_user->get_refcount() > 0);
-
/*
Aggregate EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME to:
- EVENTS_STATEMENTS_SUMMARY_BY_USER_BY_EVENT_NAME
@@ -1965,21 +2042,19 @@ void aggregate_thread_statements(PFS_thread *thread)
in parallel.
*/
aggregate_all_statements(thread->m_instr_class_statements_stats,
- thread->m_user->m_instr_class_statements_stats,
+ safe_user->m_instr_class_statements_stats,
global_instr_class_statements_array);
return;
}
- if (thread->m_host != NULL)
+ if (safe_host != NULL)
{
- DBUG_ASSERT(thread->m_host->get_refcount() > 0);
-
/*
Aggregate EVENTS_STATEMENTS_SUMMARY_BY_THREAD_BY_EVENT_NAME
to EVENTS_STATEMENTS_SUMMARY_BY_HOST_BY_EVENT_NAME, directly.
*/
aggregate_all_statements(thread->m_instr_class_statements_stats,
- thread->m_host->m_instr_class_statements_stats);
+ safe_host->m_instr_class_statements_stats);
return;
}
diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h
index 2ea44830d2b..bd2fe0e4afd 100644
--- a/storage/perfschema/pfs_instr.h
+++ b/storage/perfschema/pfs_instr.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -371,7 +371,13 @@ struct PFS_ALIGNED PFS_thread : PFS_connection_slice
PFS_events_waits *m_events_waits_current;
/** Event ID counter */
ulonglong m_event_id;
- /** Internal lock. */
+ /**
+ Internal lock.
+ This lock is exclusively used to protect against races
+ when creating and destroying PFS_thread.
+ Do not use this lock to protect thread attributes,
+ use one of @c m_stmt_lock or @c m_session_lock instead.
+ */
pfs_lock m_lock;
/** Pins for filename_hash. */
LF_PINS *m_filename_hash_pins;
@@ -460,31 +466,63 @@ struct PFS_ALIGNED PFS_thread : PFS_connection_slice
*/
PFS_events_statements *m_statements_history;
- /** User name. */
+ /**
+ Internal lock, for session attributes.
+ Statement attributes are expected to be updated in frequently,
+ typically per session execution.
+ */
+ pfs_lock m_session_lock;
+ /**
+ User name.
+ Protected by @c m_session_lock.
+ */
char m_username[USERNAME_LENGTH];
- /** Length of @c m_username. */
+ /**
+ Length of @c m_username.
+ Protected by @c m_session_lock.
+ */
uint m_username_length;
- /** Host name. */
+ /**
+ Host name.
+ Protected by @c m_session_lock.
+ */
char m_hostname[HOSTNAME_LENGTH];
- /** Length of @c m_hostname. */
+ /**
+ Length of @c m_hostname.
+ Protected by @c m_session_lock.
+ */
uint m_hostname_length;
- /** Database name. */
+ /**
+ Database name.
+ Protected by @c m_stmt_lock.
+ */
char m_dbname[NAME_LEN];
- /** Length of @c m_dbname. */
+ /**
+ Length of @c m_dbname.
+ Protected by @c m_stmt_lock.
+ */
uint m_dbname_length;
/** Current command. */
int m_command;
/** Start time. */
time_t m_start_time;
- /** Lock for Processlist state, Processlist info. */
- pfs_lock m_processlist_lock;
- /** Processlist state. */
- const char *m_processlist_state_ptr;
- /** Length of @c m_processlist_state_ptr. */
- uint m_processlist_state_length;
- /** Processlist info. */
- const char *m_processlist_info_ptr;
- /** Length of @c m_processlist_info_length. */
+ /**
+ Internal lock, for statement attributes.
+ Statement attributes are expected to be updated frequently,
+ typically per statement execution.
+ */
+ pfs_lock m_stmt_lock;
+ /** Processlist state (derived from stage). */
+ PFS_stage_key m_stage;
+ /**
+ Processlist info.
+ Protected by @c m_stmt_lock.
+ */
+ char m_processlist_info[COL_INFO_SIZE];
+ /**
+ Length of @c m_processlist_info_length.
+ Protected by @c m_stmt_lock.
+ */
uint m_processlist_info_length;
PFS_events_stages m_stage_current;
@@ -500,12 +538,21 @@ struct PFS_ALIGNED PFS_thread : PFS_connection_slice
/** Reset session connect attributes */
void reset_session_connect_attrs();
- /** a buffer for the connection attributes */
+ /**
+ Buffer for the connection attributes.
+ Protected by @c m_session_lock.
+ */
char *m_session_connect_attrs;
- /** length used by @c m_connect_attrs */
+ /**
+ Length used by @c m_connect_attrs.
+ Protected by @c m_session_lock.
+ */
uint m_session_connect_attrs_length;
- /** character set in which @c m_connect_attrs are encoded */
- const CHARSET_INFO *m_session_connect_attrs_cs;
+ /**
+ Character set in which @c m_connect_attrs are encoded.
+ Protected by @c m_session_lock.
+ */
+ uint m_session_connect_attrs_cs_number;
};
extern PFS_stage_stat *global_instr_class_stages_array;
@@ -608,10 +655,22 @@ void aggregate_all_statements(PFS_statement_stat *from_array,
PFS_statement_stat *to_array_1,
PFS_statement_stat *to_array_2);
-void aggregate_thread(PFS_thread *thread);
-void aggregate_thread_waits(PFS_thread *thread);
-void aggregate_thread_stages(PFS_thread *thread);
-void aggregate_thread_statements(PFS_thread *thread);
+void aggregate_thread(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host);
+void aggregate_thread_waits(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host);
+void aggregate_thread_stages(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host);
+void aggregate_thread_statements(PFS_thread *thread,
+ PFS_account *safe_account,
+ PFS_user *safe_user,
+ PFS_host *safe_host);
void clear_thread_account(PFS_thread *thread);
void set_thread_account(PFS_thread *thread);
diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc
index 05c85104a94..4d73396fc9b 100644
--- a/storage/perfschema/pfs_instr_class.cc
+++ b/storage/perfschema/pfs_instr_class.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -980,11 +980,14 @@ PFS_file_key register_file_class(const char *name, uint name_length,
/**
Register a stage instrumentation metadata.
@param name the instrumented name
+ @param prefix_length length in bytes of the name prefix
@param name_length length in bytes of name
@param flags the instrumentation flags
@return a stage instrumentation key
*/
-PFS_stage_key register_stage_class(const char *name, uint name_length,
+PFS_stage_key register_stage_class(const char *name,
+ uint prefix_length,
+ uint name_length,
int flags)
{
/* See comments in register_mutex_class */
@@ -1000,6 +1003,7 @@ PFS_stage_key register_stage_class(const char *name, uint name_length,
{
entry= &stage_class_array[index];
init_instr_class(entry, name, name_length, flags, PFS_CLASS_STAGE);
+ entry->m_prefix_length= prefix_length;
entry->m_event_name_index= index;
entry->m_enabled= false; /* disabled by default */
entry->m_timed= false;
diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h
index 246c6ee0b76..e50e824aee9 100644
--- a/storage/perfschema/pfs_instr_class.h
+++ b/storage/perfschema/pfs_instr_class.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -148,6 +148,12 @@ struct PFS_instr_class
{
return m_flags & PSI_FLAG_GLOBAL;
}
+
+ bool is_mutable() const
+ {
+ return m_flags & PSI_FLAG_MUTABLE;
+ }
+
static void set_enabled(PFS_instr_class *pfs, bool enabled);
static void set_timed(PFS_instr_class *pfs, bool timed);
@@ -363,6 +369,11 @@ struct PFS_ALIGNED PFS_file_class : public PFS_instr_class
/** Instrumentation metadata for a stage. */
struct PFS_ALIGNED PFS_stage_class : public PFS_instr_class
{
+ /**
+ Length of the 'stage/<component>/' prefix.
+ This is to extract 'foo' from 'stage/sql/foo'.
+ */
+ uint m_prefix_length;
/** Stage usage statistics. */
PFS_stage_stat m_stage_stat;
};
@@ -422,7 +433,9 @@ PFS_thread_key register_thread_class(const char *name, uint name_length,
PFS_file_key register_file_class(const char *name, uint name_length,
int flags);
-PFS_stage_key register_stage_class(const char *name, uint name_length,
+PFS_stage_key register_stage_class(const char *name,
+ uint prefix_length,
+ uint name_length,
int flags);
PFS_statement_key register_statement_class(const char *name, uint name_length,
diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h
index e0c782fde58..aa5dd6862fa 100644
--- a/storage/perfschema/pfs_server.h
+++ b/storage/perfschema/pfs_server.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
#define PFS_MAX_MUTEX_CLASS 200
#endif
#ifndef PFS_MAX_RWLOCK_CLASS
- #define PFS_MAX_RWLOCK_CLASS 30
+ #define PFS_MAX_RWLOCK_CLASS 40
#endif
#ifndef PFS_MAX_COND_CLASS
#define PFS_MAX_COND_CLASS 80
diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc
index 0ca7986e818..b84456d874c 100644
--- a/storage/perfschema/pfs_setup_object.cc
+++ b/storage/perfschema/pfs_setup_object.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/pfs_setup_object.cc
diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h
index 2a255a9e5b2..13a32d0e3ad 100644
--- a/storage/perfschema/pfs_stat.h
+++ b/storage/perfschema/pfs_stat.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,6 +58,11 @@ struct PFS_single_stat
m_max= 0;
}
+ inline bool has_timed_stats() const
+ {
+ return (m_min <= m_max);
+ }
+
inline void aggregate(const PFS_single_stat *stat)
{
m_count+= stat->m_count;
diff --git a/storage/perfschema/pfs_user.cc b/storage/perfschema/pfs_user.cc
index 6ae734c7d72..9f53702dd86 100644
--- a/storage/perfschema/pfs_user.cc
+++ b/storage/perfschema/pfs_user.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/pfs_user.cc
diff --git a/storage/perfschema/pfs_user.h b/storage/perfschema/pfs_user.h
index dda7e221ca8..2cb70e8e4ea 100644
--- a/storage/perfschema/pfs_user.h
+++ b/storage/perfschema/pfs_user.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef PFS_USER_H
#define PFS_USER_H
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.cc b/storage/perfschema/table_esgs_by_account_by_event_name.cc
index e36a0d0d00a..87b414c7c40 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_esgs_by_account_by_event_name.cc
diff --git a/storage/perfschema/table_esgs_by_account_by_event_name.h b/storage/perfschema/table_esgs_by_account_by_event_name.h
index c20f129de1e..2cd51783db1 100644
--- a/storage/perfschema/table_esgs_by_account_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_ESGS_BY_ACCOUNT_BY_EVENT_NAME_H
#define TABLE_ESGS_BY_ACCOUNT_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.cc b/storage/perfschema/table_esgs_by_host_by_event_name.cc
index 2357d899116..4087b22f98e 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_esgs_by_host_by_event_name.cc
diff --git a/storage/perfschema/table_esgs_by_host_by_event_name.h b/storage/perfschema/table_esgs_by_host_by_event_name.h
index 223923f3026..a8404e11e93 100644
--- a/storage/perfschema/table_esgs_by_host_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_ESGS_BY_HOST_BY_EVENT_NAME_H
#define TABLE_ESGS_BY_HOST_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.cc b/storage/perfschema/table_esgs_by_user_by_event_name.cc
index c7aff6fdb8d..cbaec6e16e9 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_esgs_by_user_by_event_name.cc
diff --git a/storage/perfschema/table_esgs_by_user_by_event_name.h b/storage/perfschema/table_esgs_by_user_by_event_name.h
index 565e633e386..9fc66033caa 100644
--- a/storage/perfschema/table_esgs_by_user_by_event_name.h
+++ b/storage/perfschema/table_esgs_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_ESGS_BY_USER_BY_EVENT_NAME_H
#define TABLE_ESGS_BY_USER_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.cc b/storage/perfschema/table_esms_by_account_by_event_name.cc
index 77f87182945..941429ad307 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_esms_by_account_by_event_name.cc
@@ -273,6 +273,9 @@ void table_esms_by_account_by_event_name
pfs_lock lock;
m_row_exists= false;
+ if (klass->is_mutable())
+ return;
+
account->m_lock.begin_optimistic_lock(&lock);
if (m_row.m_account.make_row(account))
diff --git a/storage/perfschema/table_esms_by_account_by_event_name.h b/storage/perfschema/table_esms_by_account_by_event_name.h
index d58bf9e5763..23168d03cd3 100644
--- a/storage/perfschema/table_esms_by_account_by_event_name.h
+++ b/storage/perfschema/table_esms_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_ESMS_BY_ACCOUNT_BY_EVENT_NAME_H
#define TABLE_ESMS_BY_ACCOUNT_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_esms_by_digest.cc b/storage/perfschema/table_esms_by_digest.cc
index d0250c14e5d..99e24316cbb 100644
--- a/storage/perfschema/table_esms_by_digest.cc
+++ b/storage/perfschema/table_esms_by_digest.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_esms_by_digest.cc
diff --git a/storage/perfschema/table_esms_by_digest.h b/storage/perfschema/table_esms_by_digest.h
index 2e2e595c056..5df8ec69633 100644
--- a/storage/perfschema/table_esms_by_digest.h
+++ b/storage/perfschema/table_esms_by_digest.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_ESMS_BY_DIGEST_H
#define TABLE_ESMS_BY_DIGEST_H
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.cc b/storage/perfschema/table_esms_by_host_by_event_name.cc
index 57aaf7602c4..d48808fd5c7 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_esms_by_host_by_event_name.cc
@@ -270,6 +270,9 @@ void table_esms_by_host_by_event_name
pfs_lock lock;
m_row_exists= false;
+ if (klass->is_mutable())
+ return;
+
host->m_lock.begin_optimistic_lock(&lock);
if (m_row.m_host.make_row(host))
diff --git a/storage/perfschema/table_esms_by_host_by_event_name.h b/storage/perfschema/table_esms_by_host_by_event_name.h
index 00c6beee561..c28f17a4473 100644
--- a/storage/perfschema/table_esms_by_host_by_event_name.h
+++ b/storage/perfschema/table_esms_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_ESMS_BY_HOST_BY_EVENT_NAME_H
#define TABLE_ESMS_BY_HOST_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_esms_by_thread_by_event_name.cc b/storage/perfschema/table_esms_by_thread_by_event_name.cc
index fccdf5dea60..3f3117d6dc1 100644
--- a/storage/perfschema/table_esms_by_thread_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_thread_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -272,6 +272,9 @@ void table_esms_by_thread_by_event_name
pfs_lock lock;
m_row_exists= false;
+ if (klass->is_mutable())
+ return;
+
/* Protect this reader against a thread termination */
thread->m_lock.begin_optimistic_lock(&lock);
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.cc b/storage/perfschema/table_esms_by_user_by_event_name.cc
index d65a255e280..1434966204f 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.cc
+++ b/storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_esms_by_user_by_event_name.cc
@@ -270,6 +270,9 @@ void table_esms_by_user_by_event_name
pfs_lock lock;
m_row_exists= false;
+ if (klass->is_mutable())
+ return;
+
user->m_lock.begin_optimistic_lock(&lock);
if (m_row.m_user.make_row(user))
diff --git a/storage/perfschema/table_esms_by_user_by_event_name.h b/storage/perfschema/table_esms_by_user_by_event_name.h
index 4f52b64b6b8..6dc481d3273 100644
--- a/storage/perfschema/table_esms_by_user_by_event_name.h
+++ b/storage/perfschema/table_esms_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_ESMS_BY_USER_BY_EVENT_NAME_H
#define TABLE_ESMS_BY_USER_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_esms_global_by_event_name.cc b/storage/perfschema/table_esms_global_by_event_name.cc
index efcb5b6fa7c..a335c8e6c5d 100644
--- a/storage/perfschema/table_esms_global_by_event_name.cc
+++ b/storage/perfschema/table_esms_global_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -258,6 +258,11 @@ table_esms_global_by_event_name::rnd_pos(const void *pos)
void table_esms_global_by_event_name
::make_row(PFS_statement_class *klass)
{
+ m_row_exists= false;
+
+ if (klass->is_mutable())
+ return;
+
m_row.m_event_name.make_row(klass);
PFS_connection_statement_visitor visitor(klass);
diff --git a/storage/perfschema/table_events_statements.cc b/storage/perfschema/table_events_statements.cc
index fb2b4b242d4..84bad033ec3 100644
--- a/storage/perfschema/table_events_statements.cc
+++ b/storage/perfschema/table_events_statements.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -301,7 +301,8 @@ table_events_statements_common::table_events_statements_common
Build a row.
@param statement the statement the cursor is reading
*/
-void table_events_statements_common::make_row(PFS_events_statements *statement)
+void table_events_statements_common::make_row_part_1(PFS_events_statements *statement,
+ PSI_digest_storage *digest)
{
const char *base;
const char *safe_source_file;
@@ -367,15 +368,28 @@ void table_events_statements_common::make_row(PFS_events_statements *statement)
m_row.m_no_index_used= statement->m_no_index_used;
m_row.m_no_good_index_used= statement->m_no_good_index_used;
/*
+ Making a copy of digest storage.
+ */
+ digest_copy(digest, & statement->m_digest_storage);
+
+ m_row_exists= true;
+ return;
+}
+
+
+void table_events_statements_common::make_row_part_2(PSI_digest_storage *digest)
+{
+ /*
Filling up statement digest information.
*/
- PSI_digest_storage *digest= & statement->m_digest_storage;
- if (digest->m_byte_count > 0)
+ int safe_byte_count= digest->m_byte_count;
+ if (safe_byte_count > 0 &&
+ safe_byte_count <= PSI_MAX_DIGEST_STORAGE_SIZE)
{
PFS_digest_key md5;
compute_md5_hash((char *) md5.m_md5,
(char *) digest->m_token_array,
- digest->m_byte_count);
+ safe_byte_count);
/* Generate the DIGEST string from the MD5 digest */
MD5_HASH_TO_STRING(md5.m_md5,
@@ -385,6 +399,9 @@ void table_events_statements_common::make_row(PFS_events_statements *statement)
/* Generate the DIGEST_TEXT string from the token array */
get_digest_text(m_row.m_digest.m_digest_text, digest);
m_row.m_digest.m_digest_text_length= strlen(m_row.m_digest.m_digest_text);
+
+ if (m_row.m_digest.m_digest_text_length == 0)
+ m_row.m_digest.m_digest_length= 0;
}
else
{
@@ -392,7 +409,6 @@ void table_events_statements_common::make_row(PFS_events_statements *statement)
m_row.m_digest.m_digest_text_length= 0;
}
- m_row_exists= true;
return;
}
@@ -645,7 +661,7 @@ int table_events_statements_current::rnd_next(void)
statement= &pfs_thread->m_statement_stack[m_pos.m_index_2];
- make_row(statement);
+ make_row(pfs_thread, statement);
m_next_pos.set_after(&m_pos);
return 0;
}
@@ -687,10 +703,35 @@ int table_events_statements_current::rnd_pos(const void *pos)
if (statement->m_class == NULL)
return HA_ERR_RECORD_DELETED;
- make_row(statement);
+ make_row(pfs_thread, statement);
return 0;
}
+void table_events_statements_current::make_row(PFS_thread *pfs_thread,
+ PFS_events_statements *statement)
+{
+ PSI_digest_storage digest;
+ pfs_lock lock;
+ pfs_lock stmt_lock;
+
+ digest_reset(&digest);
+ /* Protect this reader against thread termination. */
+ pfs_thread->m_lock.begin_optimistic_lock(&lock);
+ /* Protect this reader against writing on statement information. */
+ pfs_thread->m_stmt_lock.begin_optimistic_lock(&stmt_lock);
+
+ table_events_statements_common::make_row_part_1(statement, &digest);
+
+ if (!pfs_thread->m_stmt_lock.end_optimistic_lock(&stmt_lock) ||
+ !pfs_thread->m_lock.end_optimistic_lock(&lock))
+ {
+ m_row_exists= false;
+ return;
+ }
+ table_events_statements_common::make_row_part_2(&digest);
+ return;
+}
+
int table_events_statements_current::delete_all_rows(void)
{
reset_events_statements_current();
@@ -756,7 +797,7 @@ int table_events_statements_history::rnd_next(void)
if (statement->m_class != NULL)
{
- make_row(statement);
+ make_row(pfs_thread, statement);
/* Next iteration, look for the next history in this thread */
m_next_pos.set_after(&m_pos);
return 0;
@@ -790,10 +831,31 @@ int table_events_statements_history::rnd_pos(const void *pos)
if (statement->m_class == NULL)
return HA_ERR_RECORD_DELETED;
- make_row(statement);
+ make_row(pfs_thread, statement);
return 0;
}
+void table_events_statements_history::make_row(PFS_thread *pfs_thread,
+ PFS_events_statements *statement)
+{
+ PSI_digest_storage digest;
+ pfs_lock lock;
+
+ digest_reset(&digest);
+ /* Protect this reader against thread termination. */
+ pfs_thread->m_lock.begin_optimistic_lock(&lock);
+
+ table_events_statements_common::make_row_part_1(statement, &digest);
+
+ if (!pfs_thread->m_lock.end_optimistic_lock(&lock))
+ {
+ m_row_exists= false;
+ return;
+ }
+ table_events_statements_common::make_row_part_2(&digest);
+ return;
+}
+
int table_events_statements_history::delete_all_rows(void)
{
reset_events_statements_history();
@@ -878,6 +940,17 @@ int table_events_statements_history_long::rnd_pos(const void *pos)
return 0;
}
+void table_events_statements_history_long::make_row(PFS_events_statements *statement)
+{
+ PSI_digest_storage digest;
+
+ digest_reset(&digest);
+ table_events_statements_common::make_row_part_1(statement, &digest);
+
+ table_events_statements_common::make_row_part_2(&digest);
+ return;
+}
+
int table_events_statements_history_long::delete_all_rows(void)
{
reset_events_statements_history_long();
diff --git a/storage/perfschema/table_events_statements.h b/storage/perfschema/table_events_statements.h
index dcc6611f555..e33c6b505bd 100644
--- a/storage/perfschema/table_events_statements.h
+++ b/storage/perfschema/table_events_statements.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -174,7 +174,10 @@ protected:
~table_events_statements_common()
{}
- void make_row(PFS_events_statements *statement);
+ void make_row_part_1(PFS_events_statements *statement,
+ PSI_digest_storage *digest);
+
+ void make_row_part_2(PSI_digest_storage *digest);
/** Current row. */
row_events_statements m_row;
@@ -216,6 +219,8 @@ private:
*/
static TABLE_FIELD_DEF m_field_def;
+ void make_row(PFS_thread* pfs_thread, PFS_events_statements *statement);
+
/** Current position. */
pos_events_statements_current m_pos;
/** Next position. */
@@ -247,6 +252,8 @@ private:
/** Table share lock. */
static THR_LOCK m_table_lock;
+ void make_row(PFS_thread* pfs_thread, PFS_events_statements *statement);
+
/** Current position. */
pos_events_statements_history m_pos;
/** Next position. */
@@ -278,6 +285,8 @@ private:
/** Table share lock. */
static THR_LOCK m_table_lock;
+ void make_row(PFS_events_statements *statement);
+
/** Current position. */
PFS_simple_index m_pos;
/** Next position. */
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.cc b/storage/perfschema/table_ews_by_account_by_event_name.cc
index 992e7c18f17..a4b44458027 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_account_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_ews_by_account_by_event_name.cc
diff --git a/storage/perfschema/table_ews_by_account_by_event_name.h b/storage/perfschema/table_ews_by_account_by_event_name.h
index 0a0ca83131a..8ccfee599eb 100644
--- a/storage/perfschema/table_ews_by_account_by_event_name.h
+++ b/storage/perfschema/table_ews_by_account_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_EWS_BY_ACCOUNT_BY_EVENT_NAME_H
#define TABLE_EWS_BY_ACCOUNT_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.cc b/storage/perfschema/table_ews_by_host_by_event_name.cc
index 8a62990c8ed..5a02235bcb2 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_host_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_ews_by_host_by_event_name.cc
diff --git a/storage/perfschema/table_ews_by_host_by_event_name.h b/storage/perfschema/table_ews_by_host_by_event_name.h
index 28b8d0250c2..124b121e8d2 100644
--- a/storage/perfschema/table_ews_by_host_by_event_name.h
+++ b/storage/perfschema/table_ews_by_host_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_EWS_BY_HOST_BY_EVENT_NAME_H
#define TABLE_EWS_BY_HOST_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.cc b/storage/perfschema/table_ews_by_user_by_event_name.cc
index 8a169019e87..46f2ba568fb 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.cc
+++ b/storage/perfschema/table_ews_by_user_by_event_name.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_ews_by_user_by_event_name.cc
diff --git a/storage/perfschema/table_ews_by_user_by_event_name.h b/storage/perfschema/table_ews_by_user_by_event_name.h
index 88b78a1ed7a..123ee2349ae 100644
--- a/storage/perfschema/table_ews_by_user_by_event_name.h
+++ b/storage/perfschema/table_ews_by_user_by_event_name.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_EWS_BY_USER_BY_EVENT_NAME_H
#define TABLE_EWS_BY_USER_BY_EVENT_NAME_H
diff --git a/storage/perfschema/table_helper.cc b/storage/perfschema/table_helper.cc
index 9f803434ab6..9c10a3ecc88 100644
--- a/storage/perfschema/table_helper.cc
+++ b/storage/perfschema/table_helper.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_helper.cc
@@ -103,16 +103,23 @@ void PFS_account_row::set_field(uint index, Field *f)
int PFS_digest_row::make_row(PFS_statements_digest_stat* pfs)
{
+ m_schema_name_length= pfs->m_digest_key.m_schema_name_length;
+ if (m_schema_name_length > sizeof(m_schema_name))
+ m_schema_name_length= 0;
+ if (m_schema_name_length > 0)
+ memcpy(m_schema_name, pfs->m_digest_key.m_schema_name, m_schema_name_length);
+
+ int safe_byte_count= pfs->m_digest_storage.m_byte_count;
+ if (safe_byte_count > PSI_MAX_DIGEST_STORAGE_SIZE)
+ safe_byte_count= 0;
+
/*
"0" value for byte_count indicates special entry i.e. aggregated
stats at index 0 of statements_digest_stat_array. So do not calculate
digest/digest_text as it should always be "NULL".
*/
- if (pfs->m_digest_storage.m_byte_count != 0)
+ if (safe_byte_count > 0)
{
- m_schema_name_length= pfs->m_digest_key.m_schema_name_length;
- if (m_schema_name_length > 0)
- memcpy(m_schema_name, pfs->m_digest_key.m_schema_name, m_schema_name_length);
/*
Calculate digest from MD5 HASH collected to be shown as
DIGEST in this row.
@@ -126,10 +133,12 @@ int PFS_digest_row::make_row(PFS_statements_digest_stat* pfs)
*/
get_digest_text(m_digest_text, &pfs->m_digest_storage);
m_digest_text_length= strlen(m_digest_text);
+
+ if (m_digest_text_length == 0)
+ m_digest_length= 0;
}
else
{
- m_schema_name_length= 0;
m_digest_length= 0;
m_digest_text_length= 0;
}
diff --git a/storage/perfschema/table_helper.h b/storage/perfschema/table_helper.h
index 769122570eb..76bb289c73b 100644
--- a/storage/perfschema/table_helper.h
+++ b/storage/perfschema/table_helper.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2014, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef PFS_TABLE_HELPER_H
#define PFS_TABLE_HELPER_H
@@ -222,7 +222,7 @@ struct PFS_stat_row
{
m_count= stat->m_count;
- if (m_count)
+ if ((m_count != 0) && stat->has_timed_stats())
{
m_sum= normalizer->wait_to_pico(stat->m_sum);
m_min= normalizer->wait_to_pico(stat->m_min);
@@ -437,7 +437,7 @@ struct PFS_statement_stat_row
m_select_range= stat->m_select_range;
m_select_range_check= stat->m_select_range_check;
m_select_scan= stat->m_select_scan;
- m_sort_merge_passes= stat->m_sort_range;
+ m_sort_merge_passes= stat->m_sort_merge_passes;
m_sort_range= stat->m_sort_range;
m_sort_rows= stat->m_sort_rows;
m_sort_scan= stat->m_sort_scan;
diff --git a/storage/perfschema/table_host_cache.cc b/storage/perfschema/table_host_cache.cc
index 02c7f72140a..57f1ea42a02 100644
--- a/storage/perfschema/table_host_cache.cc
+++ b/storage/perfschema/table_host_cache.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2012, 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
diff --git a/storage/perfschema/table_host_cache.h b/storage/perfschema/table_host_cache.h
index 543da1274e9..74795707ac1 100644
--- a/storage/perfschema/table_host_cache.h
+++ b/storage/perfschema/table_host_cache.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2012, 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
diff --git a/storage/perfschema/table_os_global_by_type.cc b/storage/perfschema/table_os_global_by_type.cc
index 70d9d6819ac..954128a7647 100644
--- a/storage/perfschema/table_os_global_by_type.cc
+++ b/storage/perfschema/table_os_global_by_type.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_os_global_by_type.cc
diff --git a/storage/perfschema/table_os_global_by_type.h b/storage/perfschema/table_os_global_by_type.h
index 585bf6bbca5..888e3760488 100644
--- a/storage/perfschema/table_os_global_by_type.h
+++ b/storage/perfschema/table_os_global_by_type.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_OBJECTS_SUMMARY_GLOBAL_BY_TYPE_H
#define TABLE_OBJECTS_SUMMARY_GLOBAL_BY_TYPE_H
diff --git a/storage/perfschema/table_session_connect.cc b/storage/perfschema/table_session_connect.cc
index bd905b5756c..bea9b7c94db 100644
--- a/storage/perfschema/table_session_connect.cc
+++ b/storage/perfschema/table_session_connect.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -42,9 +42,26 @@ static const TABLE_FIELD_TYPE field_types[]=
TABLE_FIELD_DEF table_session_connect::m_field_def=
{ 4, field_types };
-table_session_connect::table_session_connect(const PFS_engine_table_share *share) :
- cursor_by_thread_connect_attr(share)
-{}
+table_session_connect::table_session_connect(const PFS_engine_table_share *share)
+ : cursor_by_thread_connect_attr(share)
+{
+ if (session_connect_attrs_size_per_thread > 0)
+ {
+ m_copy_session_connect_attrs= (char *) my_malloc(/* 5.7: PSI_INSTRUMENT_ME, */
+ session_connect_attrs_size_per_thread,
+ MYF(0));
+ }
+ else
+ {
+ m_copy_session_connect_attrs= NULL;
+ }
+ m_copy_session_connect_attrs_length= 0;
+}
+
+table_session_connect::~table_session_connect()
+{
+ my_free(m_copy_session_connect_attrs);
+}
/**
Take a length encoded string
@@ -175,12 +192,17 @@ bool read_nth_attr(const char *connect_attrs,
void table_session_connect::make_row(PFS_thread *pfs, uint ordinal)
{
pfs_lock lock;
+ pfs_lock session_lock;
PFS_thread_class *safe_class;
+ const CHARSET_INFO *cs;
m_row_exists= false;
/* Protect this reader against thread termination */
pfs->m_lock.begin_optimistic_lock(&lock);
+ /* Protect this reader against writing on session attributes */
+ pfs->m_session_lock.begin_optimistic_lock(&session_lock);
+
safe_class= sanitize_thread_class(pfs->m_class);
if (unlikely(safe_class == NULL))
return;
@@ -189,10 +211,39 @@ void table_session_connect::make_row(PFS_thread *pfs, uint ordinal)
if (! thread_fits(pfs))
return;
+ /* Make a safe copy of the session attributes */
+
+ if (m_copy_session_connect_attrs == NULL)
+ return;
+
+ m_copy_session_connect_attrs_length= pfs->m_session_connect_attrs_length;
+
+ if (m_copy_session_connect_attrs_length > session_connect_attrs_size_per_thread)
+ return;
+
+ memcpy(m_copy_session_connect_attrs,
+ pfs->m_session_connect_attrs,
+ m_copy_session_connect_attrs_length);
+
+ cs= get_charset(pfs->m_session_connect_attrs_cs_number, MYF(0));
+ if (cs == NULL)
+ return;
+
+ if (! pfs->m_session_lock.end_optimistic_lock(& session_lock))
+ return;
+
+ if (! pfs->m_lock.end_optimistic_lock(& lock))
+ return;
+
+ /*
+ Now we have a safe copy of the data,
+ that will not change while parsing it
+ */
+
/* populate the row */
- if (read_nth_attr(pfs->m_session_connect_attrs,
- pfs->m_session_connect_attrs_length,
- pfs->m_session_connect_attrs_cs,
+ if (read_nth_attr(m_copy_session_connect_attrs,
+ m_copy_session_connect_attrs_length,
+ cs,
ordinal,
m_row.m_attr_name, (uint) sizeof(m_row.m_attr_name),
&m_row.m_attr_name_length,
@@ -204,12 +255,9 @@ void table_session_connect::make_row(PFS_thread *pfs, uint ordinal)
m_row.m_ordinal_position= ordinal;
m_row.m_process_id= pfs->m_processlist_id;
- }
- else
- return;
- if (pfs->m_lock.end_optimistic_lock(& lock))
m_row_exists= true;
+ }
}
int table_session_connect::read_row_values(TABLE *table,
diff --git a/storage/perfschema/table_session_connect.h b/storage/perfschema/table_session_connect.h
index 097623d2c80..e6faa283e42 100644
--- a/storage/perfschema/table_session_connect.h
+++ b/storage/perfschema/table_session_connect.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,8 +58,7 @@ protected:
table_session_connect(const PFS_engine_table_share *share);
public:
- ~table_session_connect()
- {}
+ ~table_session_connect();
protected:
virtual void make_row(PFS_thread *pfs, uint ordinal);
@@ -71,6 +70,10 @@ protected:
static TABLE_FIELD_DEF m_field_def;
/** Current row. */
row_session_connect_attrs m_row;
+ /** Safe copy of @c PFS_thread::m_session_connect_attrs. */
+ char *m_copy_session_connect_attrs;
+ /** Safe copy of @c PFS_thread::m_session_connect_attrs_length. */
+ uint m_copy_session_connect_attrs_length;
};
/** @} */
diff --git a/storage/perfschema/table_setup_actors.cc b/storage/perfschema/table_setup_actors.cc
index 91dbb942ead..00699a9c2e5 100644
--- a/storage/perfschema/table_setup_actors.cc
+++ b/storage/perfschema/table_setup_actors.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
diff --git a/storage/perfschema/table_threads.cc b/storage/perfschema/table_threads.cc
index b1ec2ad754e..0774858ca92 100644
--- a/storage/perfschema/table_threads.cc
+++ b/storage/perfschema/table_threads.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2008, 2014, 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
@@ -129,7 +129,9 @@ table_threads::table_threads()
void table_threads::make_row(PFS_thread *pfs)
{
pfs_lock lock;
- pfs_lock processlist_lock;
+ pfs_lock session_lock;
+ pfs_lock stmt_lock;
+ PFS_stage_class *stage_class;
PFS_thread_class *safe_class;
m_row_exists= false;
@@ -147,6 +149,9 @@ void table_threads::make_row(PFS_thread *pfs)
m_row.m_name= safe_class->m_name;
m_row.m_name_length= safe_class->m_name_length;
+ /* Protect this reader against session attribute changes */
+ pfs->m_session_lock.begin_optimistic_lock(&session_lock);
+
m_row.m_username_length= pfs->m_username_length;
if (unlikely(m_row.m_username_length > sizeof(m_row.m_username)))
return;
@@ -159,38 +164,66 @@ void table_threads::make_row(PFS_thread *pfs)
if (m_row.m_hostname_length != 0)
memcpy(m_row.m_hostname, pfs->m_hostname, m_row.m_hostname_length);
+ if (! pfs->m_session_lock.end_optimistic_lock(& session_lock))
+ {
+ /*
+ One of the columns:
+ - PROCESSLIST_USER
+ - PROCESSLIST_HOST
+ is being updated.
+ Do not discard the entire row.
+ Do not loop waiting for a stable value.
+ Just return NULL values.
+ */
+ m_row.m_username_length= 0;
+ m_row.m_hostname_length= 0;
+ }
+
+ /* Protect this reader against statement attributes changes */
+ pfs->m_stmt_lock.begin_optimistic_lock(&stmt_lock);
+
m_row.m_dbname_length= pfs->m_dbname_length;
if (unlikely(m_row.m_dbname_length > sizeof(m_row.m_dbname)))
return;
if (m_row.m_dbname_length != 0)
memcpy(m_row.m_dbname, pfs->m_dbname, m_row.m_dbname_length);
- m_row.m_command= pfs->m_command;
- m_row.m_start_time= pfs->m_start_time;
-
- /* Protect this reader against attribute changes. */
- pfs->m_processlist_lock.begin_optimistic_lock(&processlist_lock);
-
- /* FIXME: need to copy it ? */
- m_row.m_processlist_state_ptr= pfs->m_processlist_state_ptr;
- m_row.m_processlist_state_length= pfs->m_processlist_state_length;
- /* FIXME: need to copy it ? */
- m_row.m_processlist_info_ptr= pfs->m_processlist_info_ptr;
+ m_row.m_processlist_info_ptr= & pfs->m_processlist_info[0];
m_row.m_processlist_info_length= pfs->m_processlist_info_length;
- if (! pfs->m_processlist_lock.end_optimistic_lock(& processlist_lock))
+ if (! pfs->m_stmt_lock.end_optimistic_lock(& stmt_lock))
{
/*
- Columns PROCESSLIST_STATE or PROCESSLIST_INFO are being
- updated while we read them, and are unsafe to use.
+ One of the columns:
+ - PROCESSLIST_DB
+ - PROCESSLIST_INFO
+ is being updated.
Do not discard the entire row.
Do not loop waiting for a stable value.
- Just return NULL values for these columns.
+ Just return NULL values.
*/
- m_row.m_processlist_state_length= 0;
+ m_row.m_dbname_length= 0;
m_row.m_processlist_info_length= 0;
}
+ /* Dirty read, sanitize the command. */
+ m_row.m_command= pfs->m_command;
+ if ((m_row.m_command < 0) || (m_row.m_command > COM_END))
+ m_row.m_command= COM_END;
+
+ m_row.m_start_time= pfs->m_start_time;
+
+ stage_class= find_stage_class(pfs->m_stage);
+ if (stage_class != NULL)
+ {
+ m_row.m_processlist_state_ptr= stage_class->m_name + stage_class->m_prefix_length;
+ m_row.m_processlist_state_length= stage_class->m_name_length - stage_class->m_prefix_length;
+ }
+ else
+ {
+ m_row.m_processlist_state_length= 0;
+ }
+
m_row.m_enabled_ptr= &pfs->m_enabled;
if (pfs->m_lock.end_optimistic_lock(& lock))
@@ -276,8 +309,22 @@ int table_threads::read_row_values(TABLE *table,
break;
case 9: /* PROCESSLIST_STATE */
if (m_row.m_processlist_state_length > 0)
+ {
+ /* This column's datatype is declared as varchar(64). But in current
+ code, there are few process state messages which are greater than
+ 64 characters(Eg:stage_slave_has_read_all_relay_log).
+ In those cases, we will end up in 'data truncated'
+ warning/error (depends sql_mode setting) when server is updating
+ this column for those threads. Since 5.6 is GAed, neither the
+ metadata of this column can be changed, nor those state messages.
+ So server will silently truncate the state message to 64 characters
+ if it is longer. In Upper versions(5.7+), these state messages are
+ changed to less than or equal to 64 characters.
+ */
set_field_varchar_utf8(f, m_row.m_processlist_state_ptr,
- m_row.m_processlist_state_length);
+ std::min<uint>(m_row.m_processlist_state_length,
+ f->char_length()));
+ }
else
f->set_null();
break;
diff --git a/storage/perfschema/table_tiws_by_table.cc b/storage/perfschema/table_tiws_by_table.cc
index f793b5654a2..ab6ad3f5e3f 100644
--- a/storage/perfschema/table_tiws_by_table.cc
+++ b/storage/perfschema/table_tiws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_tiws_by_table.cc
diff --git a/storage/perfschema/table_tiws_by_table.h b/storage/perfschema/table_tiws_by_table.h
index 747b1958c8e..ea52b5297d7 100644
--- a/storage/perfschema/table_tiws_by_table.h
+++ b/storage/perfschema/table_tiws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_IO_WAITS_SUMMARY_BY_TABLE_H
#define TABLE_IO_WAITS_SUMMARY_BY_TABLE_H
diff --git a/storage/perfschema/table_tlws_by_table.cc b/storage/perfschema/table_tlws_by_table.cc
index c6f454ac178..7d33b42648e 100644
--- a/storage/perfschema/table_tlws_by_table.cc
+++ b/storage/perfschema/table_tlws_by_table.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/**
@file storage/perfschema/table_tlws_by_table.cc
diff --git a/storage/perfschema/table_tlws_by_table.h b/storage/perfschema/table_tlws_by_table.h
index c5521c72470..fc396447bcf 100644
--- a/storage/perfschema/table_tlws_by_table.h
+++ b/storage/perfschema/table_tlws_by_table.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#ifndef TABLE_LOCK_WAITS_SUMMARY_BY_TABLE_H
#define TABLE_LOCK_WAITS_SUMMARY_BY_TABLE_H
diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt
index 47539ffd211..b237d6b4ee0 100644
--- a/storage/perfschema/unittest/CMakeLists.txt
+++ b/storage/perfschema/unittest/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
${CMAKE_SOURCE_DIR}/include/mysql
@@ -63,7 +63,7 @@ TARGET_LINK_LIBRARIES(pfs_connect_attr-t ${MYSQLD_STATIC_PLUGIN_LIBS})
TARGET_LINK_LIBRARIES(pfs_connect_attr-t sql binlog rpl master slave sql)
TARGET_LINK_LIBRARIES(pfs_connect_attr-t mysys mysys_ssl)
TARGET_LINK_LIBRARIES(pfs_connect_attr-t vio ${SSL_LIBRARIES})
-TARGET_LINK_LIBRARIES(pfs_connect_attr-t strings dbug regex mysys zlib)
+TARGET_LINK_LIBRARIES(pfs_connect_attr-t strings dbug regex mysys ${ZLIB_LIBRARY})
ADD_TEST(pfs_connect_attr pfs_connect_attr-t)
# On windows, pfs_connect_attr-t may depend on openssl dlls.
diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc
index f877615da0f..7574de542f8 100644
--- a/storage/perfschema/unittest/pfs_account-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_account-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2012, 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
diff --git a/storage/perfschema/unittest/pfs_host-oom-t.cc b/storage/perfschema/unittest/pfs_host-oom-t.cc
index cdc9764210a..32d9c23cbde 100644
--- a/storage/perfschema/unittest/pfs_host-oom-t.cc
+++ b/storage/perfschema/unittest/pfs_host-oom-t.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2011, 2012, 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
diff --git a/storage/perfschema/unittest/stub_pfs_defaults.h b/storage/perfschema/unittest/stub_pfs_defaults.h
index 042d069b367..f4fa24245d5 100644
--- a/storage/perfschema/unittest/stub_pfs_defaults.h
+++ b/storage/perfschema/unittest/stub_pfs_defaults.h
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
#include <my_global.h>
#include <pfs.h>
diff --git a/storage/perfschema/unittest/stub_server_misc.h b/storage/perfschema/unittest/stub_server_misc.h
index 8b008273bd8..946da533727 100644
--- a/storage/perfschema/unittest/stub_server_misc.h
+++ b/storage/perfschema/unittest/stub_server_misc.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2010, 2012, 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
@@ -11,7 +11,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
/*
Minimal code to be able to link a unit test.