diff options
190 files changed, 2628 insertions, 757 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/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/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 a76e7f3a646..86967a2a63f 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/TABLE_SHARE::tdc.LOCK_table_share' GROUP BY NAME; diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result index e7af3cdc006..6f5affadd2f 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 @@ -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_dbug= "-d,native_password_bad_reply"; +message +Valid connection should reset SUM_CONNECT_ERROR counter +set global debug_dbug= "+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_dbug= default; diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result index 2e9ad44b58d..5d1846f3354 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 @@ -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_dbug= "-d,native_password_bad_reply"; +message +Valid connection should reset SUM_CONNECT_ERROR counter +set global debug_dbug= "+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_dbug= default; diff --git a/mysql-test/suite/perfschema/r/myisam_file_io.result b/mysql-test/suite/perfschema/r/myisam_file_io.result index 826c4563932..ea1e0bd52b8 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 0eb5ff8c737..bef2759da41 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 \"", @@ -115,7 +116,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 179 +performance_schema_max_statement_classes 180 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/privilege_table_io.result b/mysql-test/suite/perfschema/r/privilege_table_io.result index 02e3ed7da62..838d17e61fe 100644 --- a/mysql-test/suite/perfschema/r/privilege_table_io.result +++ b/mysql-test/suite/perfschema/r/privilege_table_io.result @@ -46,7 +46,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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/rpl_statements.result b/mysql-test/suite/perfschema/r/rpl_statements.result new file mode 100644 index 00000000000..e271cd2a7fa --- /dev/null +++ b/mysql-test/suite/perfschema/r/rpl_statements.result @@ -0,0 +1,241 @@ +include/master-slave.inc +[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 2ea7d17a888..e502376b578 100644 --- a/mysql-test/suite/perfschema/r/setup_instruments_defaults.result +++ b/mysql-test/suite/perfschema/r/setup_instruments_defaults.result @@ -1,13 +1,18 @@ +# +# 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_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'; @@ -23,13 +28,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 dc652f8bbbf..b27ecd52226 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_idle.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_idle.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_stages.result b/mysql-test/suite/perfschema/r/start_server_disable_stages.result index 2984360fad9..0b8e00a5653 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_stages.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_stages.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_statements.result b/mysql-test/suite/perfschema/r/start_server_disable_statements.result index 2f0cff977e7..8e8d1498b9f 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_statements.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_statements.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_disable_waits.result b/mysql-test/suite/perfschema/r/start_server_disable_waits.result index 1a1062d3201..d4b02dedc2c 100644 --- a/mysql-test/suite/perfschema/r/start_server_disable_waits.result +++ b/mysql-test/suite/perfschema/r/start_server_disable_waits.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_innodb.result b/mysql-test/suite/perfschema/r/start_server_innodb.result index 58d4e611812..0d7ea7d6294 100644 --- a/mysql-test/suite/perfschema/r/start_server_innodb.result +++ b/mysql-test/suite/perfschema/r/start_server_innodb.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_account.result b/mysql-test/suite/perfschema/r/start_server_no_account.result index cf5b5ba09e0..b9ec719ed58 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_account.result +++ b/mysql-test/suite/perfschema/r/start_server_no_account.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result index 805bb3a2cce..4fac77bc0cc 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result index 172ca779e18..75cd54776eb 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result index e8c1580fd03..9922fcaa016 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result index 02be2fe9585..6e8735f6a1f 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_host.result b/mysql-test/suite/perfschema/r/start_server_no_host.result index 7d5fdaf7134..f5dae7c61d9 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_host.result +++ b/mysql-test/suite/perfschema/r/start_server_no_host.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result index 1ee6c681d01..4b3c8790b58 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result index 6d51baa0d2f..92ec4cf61fc 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result index 7bead1375fe..e4ac0d0fa8b 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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result index f4a6264e573..3bba543f3b8 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 @@ -93,7 +93,7 @@ performance_schema_max_rwlock_instances 0 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result b/mysql-test/suite/perfschema/r/start_server_no_setup_actors.result index 6f2dc52e485..2c3ef382fb9 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result b/mysql-test/suite/perfschema/r/start_server_no_setup_objects.result index 210a5e677e9..0b49b4d055a 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_class.result b/mysql-test/suite/perfschema/r/start_server_no_socket_class.result index e495686fa63..9cf73c2b78d 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 @@ -93,7 +93,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 0 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result b/mysql-test/suite/perfschema/r/start_server_no_socket_inst.result index 474875f2de7..6da66d6ee75 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 @@ -93,7 +93,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 0 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stage_class.result b/mysql-test/suite/perfschema/r/start_server_no_stage_class.result index 6ccd55451ac..532935bb0ff 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 @@ -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 0 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history.result index 6443cba13df..360571bc326 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_stages_history_long.result index ad44f26b880..d458e3da9b1 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history.result index cd21d415dad..2682ea22f88 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_statements_history_long.result index 2fa222208b3..9568e9ad56b 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result index 46d18a2e354..c189d9a5024 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 0 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result index a098c3556f0..a440cfe3302 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 0 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result index da1de089ef8..d9c945ea8cb 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result index e8663c0baf3..f5ce5bebb51 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_user.result b/mysql-test/suite/perfschema/r/start_server_no_user.result index 84c9da61842..53cb0051f97 100644 --- a/mysql-test/suite/perfschema/r/start_server_no_user.result +++ b/mysql-test/suite/perfschema/r/start_server_no_user.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history.result index ba1b38ec1ae..125274550eb 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result b/mysql-test/suite/perfschema/r/start_server_no_waits_history_long.result index db1f905da73..50212863574 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 @@ -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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result index 9d1259394a3..08847829579 100644 --- a/mysql-test/suite/perfschema/r/start_server_off.result +++ b/mysql-test/suite/perfschema/r/start_server_off.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result index 58d4e611812..0d7ea7d6294 100644 --- a/mysql-test/suite/perfschema/r/start_server_on.result +++ b/mysql-test/suite/perfschema/r/start_server_on.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 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result index b4af9d021ef..ea2980e5755 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result index 6ccc81c5581..f51e8383019 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result index b7ed12e9f00..a7844b6b0e6 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result index 4f45ae0fedd..4d089c810a1 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result index 937a6bc11f4..23bd1294445 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result @@ -61,7 +61,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result index d6436c2f4ac..7edfc3824bb 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result @@ -60,7 +60,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result index fa805e36760..99d2e7d4655 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result @@ -61,7 +61,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result index 5b0105ab137..f8c660bd932 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result @@ -60,7 +60,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result index 62d619854a8..73ed3550a77 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_off.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result index 7c91487477c..3906c6f6b84 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result index e4a3aabd51b..0b579f54a66 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result index f6d2ac4fb19..e137525e5b0 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result index f76b83d2854..799555b685e 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result index a5c6f669eb6..bf920a30af3 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result index a327eadeb75..d100f2a5e08 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result index 2cd3cd51329..a5d046f154c 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result index 40eb000ea84..413a566fefb 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result index bc348ffdd1c..4a5e7aeede1 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result index 5f30bde9421..25ba676993a 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result index 9a147466a78..41292e5913e 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result index 63b1f709b72..fc7c523ed8c 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result index ac740035848..210928a0c04 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result index 8fa0ff230e3..9df65066d45 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result index 83d70261823..a9109fa42d2 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result index 5dac5f5b83a..542b020f77a 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result index f702ebadfc0..ece0dadebd0 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result index 693723f6538..956540b9327 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result index 274b9c22b9f..72f0240c6be 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result index 2cf43f9b47a..a93cc1b6499 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result index 412353b73dd..0e1b7032af6 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result index 487bc91e784..fb1fd8fb207 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result index 1fe09b3008f..f97272634b9 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result @@ -63,7 +63,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result index 5bbd3ca022c..ddf8ef7bf9d 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result @@ -62,7 +62,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result index 4fd4f505454..588a378024a 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result index a3e0129bb70..76c466d48cc 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result index 3edba653026..2450456355a 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result @@ -65,7 +65,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result index 461ff5da3dd..72b46a2820b 100644 --- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result @@ -64,7 +64,7 @@ performance_schema_max_rwlock_instances 5000 performance_schema_max_socket_classes 10 performance_schema_max_socket_instances 1000 performance_schema_max_stage_classes 150 -performance_schema_max_statement_classes 179 +performance_schema_max_statement_classes 180 performance_schema_max_table_handles 1000 performance_schema_max_table_instances 500 performance_schema_max_thread_classes 50 diff --git a/mysql-test/suite/perfschema/t/disabled.def b/mysql-test/suite/perfschema/t/disabled.def index 79b31af3066..888298bbb09 100644 --- a/mysql-test/suite/perfschema/t/disabled.def +++ b/mysql-test/suite/perfschema/t/disabled.def @@ -9,5 +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..372cda050ee 100644 --- a/mysql-test/suite/perfschema/t/event_aggregate.test +++ b/mysql-test/suite/perfschema/t/event_aggregate.test @@ -4,4 +4,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a.test index c1a895ec549..372cda050ee 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,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_h.test index c1a895ec549..372cda050ee 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,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u.test index c1a895ec549..372cda050ee 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,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_a_no_u_no_h.test index c1a895ec549..372cda050ee 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,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_h.test index c1a895ec549..372cda050ee 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,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_u.test b/mysql-test/suite/perfschema/t/event_aggregate_no_u.test index c1a895ec549..372cda050ee 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,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test b/mysql-test/suite/perfschema/t/event_aggregate_no_u_no_h.test index c1a895ec549..372cda050ee 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,3 @@ --source ../include/event_aggregate_setup.inc --source ../include/event_aggregate_load.inc --source ../include/event_aggregate_cleanup.inc - diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test index 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 01bf7e14d96..ca1feb68091 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 4e735156c4b..7c89aa3d44e 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(); @@ -75,7 +78,70 @@ flush hosts; --disable_query_log --error ER_HANDSHAKE_ERROR -connect (con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,); +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_dbug= "-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_dbug= "+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_dbug= default; diff --git a/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test b/mysql-test/suite/perfschema/t/hostcache_ipv6_blocked.test index 4d3defe77cc..9d4707dc027 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(); @@ -76,7 +79,70 @@ flush hosts; --disable_query_log --error ER_HANDSHAKE_ERROR -connect (con2c,"::1",quota,,test,$MASTER_MYPORT,); +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_dbug= "-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_dbug= "+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_dbug= default; diff --git a/mysql-test/suite/perfschema/t/myisam_file_io.test b/mysql-test/suite/perfschema/t/myisam_file_io.test index d93edd7d3b6..3b6a1369ab5 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..21e7260222a 100644 --- a/mysql-test/suite/perfschema/t/nesting.test +++ b/mysql-test/suite/perfschema/t/nesting.test @@ -45,11 +45,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.test b/mysql-test/suite/perfschema/t/rpl_statements.test new file mode 100644 index 00000000000..fa429cd2aa3 --- /dev/null +++ b/mysql-test/suite/perfschema/t/rpl_statements.test @@ -0,0 +1,339 @@ +# +# Check statement instrumentation of replicated statements +# +--source include/not_embedded.inc +--source include/have_innodb.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..408eb5c79d2 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,29 @@ --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..5fd5acceb34 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/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 ab942ab2ea5..016a50abbe5 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 @@ -272,7 +272,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); @@ -325,7 +328,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); @@ -337,6 +343,7 @@ int ha_perfschema::rnd_next(uchar *buf) if (result == 0) stats.records++; } + table->status= (result ? STATUS_NOT_FOUND : 0); DBUG_RETURN(result); } @@ -353,13 +360,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); } @@ -382,6 +393,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 000eeeca024..ff87b1fd665 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 @@ -195,6 +197,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 33b21ee2817..fa87269a054 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 b91039f6cd7..0e4c6cb1d04 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 @@ -323,17 +323,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: @@ -342,30 +342,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; } @@ -374,9 +374,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: @@ -385,12 +385,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: @@ -399,19 +399,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; } @@ -424,9 +424,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: @@ -435,12 +435,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: @@ -449,19 +449,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; } @@ -474,26 +474,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; } @@ -515,9 +515,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)) @@ -562,15 +563,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 fb438f105ab..c8800e7ec96 100644 --- a/storage/perfschema/pfs_check.cc +++ b/storage/perfschema/pfs_check.cc @@ -57,8 +57,6 @@ void check_performance_schema() thd->reset_globals(); delete thd; - /* Remember that we don't have a THD */ - set_current_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 6edcba4c013..5db626314a2 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_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 e823a0605e8..2799550c81d 100644 --- a/storage/perfschema/pfs_events_waits.cc +++ b/storage/perfschema/pfs_events_waits.cc @@ -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_host.cc b/storage/perfschema/pfs_host.cc index ac6308ff991..08f49f091a8 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 45e4bfbb3d0..cfae076536c 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; @@ -605,6 +629,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) { /* @@ -649,6 +684,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; } @@ -666,6 +710,7 @@ void destroy_mutex(PFS_mutex *pfs) if (klass->is_singleton()) klass->m_singleton= NULL; pfs->m_lock.allocated_to_free(); + mutex_full= false; } /** @@ -681,6 +726,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() */ @@ -709,6 +760,7 @@ PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity) } rwlock_lost++; + rwlock_full= true; return NULL; } @@ -726,6 +778,7 @@ void destroy_rwlock(PFS_rwlock *pfs) if (klass->is_singleton()) klass->m_singleton= NULL; pfs->m_lock.allocated_to_free(); + rwlock_full= false; } /** @@ -741,6 +794,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() */ @@ -767,6 +826,7 @@ PFS_cond* create_cond(PFS_cond_class *klass, const void *identity) } cond_lost++; + cond_full= true; return NULL; } @@ -784,6 +844,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() @@ -795,7 +856,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) ) @@ -822,6 +883,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() */ @@ -837,6 +904,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]; @@ -864,11 +933,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; @@ -946,6 +1013,7 @@ PFS_thread* create_thread(PFS_thread_class *klass, const void *identity, } thread_lost++; + thread_full= true; return NULL; } @@ -1057,6 +1125,7 @@ void destroy_thread(PFS_thread *pfs) pfs->m_digest_hash_pins= NULL; } pfs->m_lock.allocated_to_free(); + thread_full= false; } /** @@ -1207,6 +1276,12 @@ search: return NULL; } + if (file_full) + { + file_lost++; + return NULL; + } + while (++attempts <= file_max) { /* See create_mutex() */ @@ -1260,6 +1335,7 @@ search: } file_lost++; + file_full= true; return NULL; } @@ -1299,6 +1375,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; } /** @@ -1316,6 +1393,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() */ @@ -1346,6 +1429,7 @@ PFS_table* create_table(PFS_table_share *share, PFS_thread *opening_thread, } table_lost++; + table_full= true; return NULL; } @@ -1443,6 +1527,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; } /** @@ -1459,6 +1544,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; @@ -1508,6 +1599,7 @@ PFS_socket* create_socket(PFS_socket_class *klass, const my_socket *fd, } socket_lost++; + socket_full= true; return NULL; } @@ -1545,6 +1637,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) @@ -1760,55 +1853,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 @@ -1816,34 +1911,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; } @@ -1851,29 +1942,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 @@ -1881,15 +1968,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 @@ -1897,21 +1982,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; } @@ -1923,29 +2006,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 @@ -1953,15 +2032,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 @@ -1969,21 +2046,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 24a06cf494c..84e0a0357a0 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 d0b90734b66..a51af2eca12 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); @@ -365,6 +371,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; }; @@ -424,7 +435,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 b647833f43a..606a814c168 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 diff --git a/storage/perfschema/pfs_setup_object.cc b/storage/perfschema/pfs_setup_object.cc index 535dd53bfc7..c77039663b2 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 60d6a2e99f6..905c0b2ee4e 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 aaf18a5475b..4f0fc6858f9 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 dd64d2f6e9d..904f0e21b3c 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 0e94ed162c4..736559dd5e2 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 c6a4ba5cf31..436056ef30b 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 a31572d5f6b..80fa4077281 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 8d68b2c948c..2cbe70d5ae4 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 d1e6105e0a8..9ab2a814443 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 48e9026c575..6b55fb82814 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 57522cb466d..e1b65559642 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 638284003dc..96a79eecd00 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 0b345cb9d83..251fbc74536 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 ea96a040d88..38f94ebc11b 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 e1f852aa6d5..b8365064a26 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 879c7ef4860..70efcd46bbf 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 0acc7582ac5..f6c9a85a95d 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 073c9881a85..df3337b284c 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, 0, (uint*) 0 }; -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 ead22c23319..a73ec452980 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 ef6c272c0a2..1fd2486589c 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 5e78c8d8b1c..7eeebccb8a9 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 df2d301e352..6537e709549 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 b44d0173029..6add43de7f9 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 diff --git a/storage/perfschema/unittest/pfs_account-oom-t.cc b/storage/perfschema/unittest/pfs_account-oom-t.cc index 8fa6f340cbf..2343e8378ad 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 3d3dfd6d05e..5b823ce4eac 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 b206351b409..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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* Minimal code to be able to link a unit test. |