List:Commits« Previous MessageNext Message »
From:Marc Alff Date:January 10 2012 9:03pm
Subject:bzr push into mysql-trunk-wl5259 branch (marc.alff:3343 to 3344)
View as plain text  
 3344 Marc Alff	2012-01-10
      Testing in progress, continued

    added:
      mysql-test/suite/perfschema/include/hostcache_dump.inc
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test
    modified:
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
      mysql-test/suite/perfschema/r/hostcache_peer_addr.result
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/table_schema.result
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_format.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test
      mysql-test/suite/perfschema/t/hostcache_peer_addr.test
      scripts/mysql_system_tables.sql
      sql/hostname.cc
      sql/hostname.h
      storage/perfschema/pfs_engine_table.cc
      storage/perfschema/table_host_cache.cc
      storage/perfschema/table_host_cache.h
 3343 Marc Alff	2012-01-10 [merge]
      Merge mysql-trunk --> mysql-trunk-wl5259

    added:
      mysql-test/suite/innodb/r/innodb_bug12400341.result
      mysql-test/suite/innodb/t/innodb_bug12400341-master.opt
      mysql-test/suite/innodb/t/innodb_bug12400341.test
    modified:
      client/mysqlbinlog.cc
      mysql-test/collections/default.experimental
      mysql-test/suite/innodb_fts/r/innodb_fts_large_records.result
      mysql-test/suite/innodb_fts/t/disabled.def
      mysql-test/suite/innodb_fts/t/innodb_fts_large_records.test
      mysql-test/suite/sys_vars/r/all_vars.result
      mysql-test/suite/sys_vars/t/all_vars.test
      mysql-test/suite/sys_vars/t/disabled.def
      storage/innobase/fts/fts0fts.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/trx0rseg.ic
      storage/innobase/include/trx0sys.h
      storage/innobase/row/row0mysql.cc
      storage/innobase/trx/trx0sys.cc
=== added file 'mysql-test/suite/perfschema/include/hostcache_dump.inc'
--- a/mysql-test/suite/perfschema/include/hostcache_dump.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/include/hostcache_dump.inc	2012-01-10 21:02:53 +0000
@@ -0,0 +1,7 @@
+# Helper for hostcache_*.test
+
+show global status like "%peer%";
+--vertical_results
+select * from performance_schema.host_cache;
+--horizontal_results
+

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result	2012-01-10 21:02:53 +0000
@@ -15,18 +15,48 @@ select current_user();
 current_user()
 root@localhost
 set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
-ERROR HY000: Can't get hostname for your address
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-ERROR HY000: Can't get hostname for your address
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_ERRORS	1
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	1
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_ERRORS	2
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	2
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 drop user 'root'@'santa.claus.ipv4.example.com';
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result	2012-01-10 21:02:53 +0000
@@ -14,16 +14,46 @@ select current_user();
 current_user()
 root@localhost
 set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
-ERROR HY000: Can't get hostname for your address
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-ERROR HY000: Can't get hostname for your address
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_ERRORS	1
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	1
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_ERRORS	2
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	2
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 set global debug= default;

=== added file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result	2012-01-10 21:02:53 +0000
@@ -0,0 +1,71 @@
+flush status;
+flush hosts;
+select @@global.debug;
+@@global.debug
+
+show global status like "%peer%";
+Variable_name	Value
+Peer_address_errors	0
+grant select on test.* to 'root'@'192.0.2.4';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
+select "Con2 is alive";
+Con2 is alive
+Con2 is alive
+select current_user();
+current_user()
+root@stripped
+show global status like "%peer%";
+Variable_name	Value
+Peer_address_errors	0
+select * from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	1
+COUNT_HOST_ACL_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+select "Con3 is alive";
+Con3 is alive
+Con3 is alive
+select current_user();
+current_user()
+root@stripped
+show global status like "%peer%";
+Variable_name	Value
+Peer_address_errors	0
+select * from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_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	2
+COUNT_HOST_ACL_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result	2012-01-10 21:02:53 +0000
@@ -1,4 +1,3 @@
-call mtr.add_suppression("192.0.2.4");
 flush status;
 flush hosts;
 select @@global.debug;
@@ -19,13 +18,41 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	0	1	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_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	1
+COUNT_HOST_ACL_ERRORS	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	0	1	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_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	2
+COUNT_HOST_ACL_ERRORS	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result	2012-01-10 21:02:53 +0000
@@ -25,8 +25,22 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	santa.claus.ipv4.example.com	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 select "Con3 is alive";
 Con3 is alive
 Con3 is alive
@@ -37,8 +51,22 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	santa.claus.ipv4.example.com	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 drop user 'root'@'santa.claus.ipv4.example.com';
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result	2012-01-10 21:02:53 +0000
@@ -19,13 +19,41 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	santa.claus.ipv4.example.com	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	santa.claus.ipv4.example.com	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result	2012-01-10 21:02:53 +0000
@@ -26,8 +26,22 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	1	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	YES
+SUM_BLOCKING_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	1
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 select "Con3 is alive";
 Con3 is alive
 Con3 is alive
@@ -38,8 +52,22 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	1	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	YES
+SUM_BLOCKING_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	1
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 revoke select on test.* from 'root'@'192.0.2.4';
 drop user 'root'@'santa.claus.ipv4.example.com';

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result	2012-01-10 21:02:53 +0000
@@ -19,13 +19,41 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	1	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	YES
+SUM_BLOCKING_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	1
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	1	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	YES
+SUM_BLOCKING_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	1
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_format.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result	2012-01-10 21:02:53 +0000
@@ -19,13 +19,41 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	1	0	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_ERRORS	1
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	1
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	1	0	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_ERRORS	2
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	2
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result	2012-01-10 21:02:53 +0000
@@ -8,6 +8,7 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 grant select on test.* to 'root'@'192.0.2.4';
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
 select "Con1 is alive";
 Con1 is alive
 Con1 is alive
@@ -25,7 +26,6 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
 select "Con3 is alive";
 Con3 is alive
 Con3 is alive
@@ -36,7 +36,61 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+select "Con4 is alive";
+Con4 is alive
+Con4 is alive
+select current_user();
+current_user()
+root@stripped
+show global status like "%peer%";
+Variable_name	Value
+Peer_address_errors	0
+select * from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+select "Con5 is alive";
+Con5 is alive
+Con5 is alive
+select current_user();
+current_user()
+root@stripped
+show global status like "%peer%";
+Variable_name	Value
+Peer_address_errors	0
+select * from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 revoke select on test.* from 'root'@'192.0.2.4';
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 drop user 'root'@'192.0.2.4';
+drop user 'root'@'santa.claus.ipv4.example.com';
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result	2012-01-10 21:02:53 +0000
@@ -19,26 +19,52 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
 ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
 set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
 ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	santa.claus.ipv4.example.com	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	santa.claus.ipv4.example.com	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_BLOCKING_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	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result	2012-01-10 21:02:53 +0000
@@ -25,8 +25,22 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_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_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 select "Con3 is alive";
 Con3 is alive
 Con3 is alive
@@ -37,8 +51,22 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_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_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 revoke select on test.* from 'root'@'192.0.2.4';
 drop user 'root'@'192.0.2.4';
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result	2012-01-10 21:02:53 +0000
@@ -19,13 +19,41 @@ show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_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	1
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MySQL server
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	0
 select * from performance_schema.host_cache;
-IP	HOST	SUM_BLOCKING_ERRORS	COUNT_NAMEINFO_ERRORS	COUNT_FORMAT_ERRORS	COUNT_ADDRINFO_ERRORS	COUNT_FCRDNS_ERRORS	COUNT_HOST_ACL_ERRORS	COUNT_USER_ACL_ERRORS
-192.0.2.4	NULL	0	0	0	0	0	12	12
+IP	192.0.2.4
+HOST	NULL
+HOST_VALIDATED	NO
+SUM_BLOCKING_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	2
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_USER_ACL_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
 set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/hostcache_peer_addr.result'
--- a/mysql-test/suite/perfschema/r/hostcache_peer_addr.result	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_peer_addr.result	2012-01-10 21:02:53 +0000
@@ -17,10 +17,12 @@ ERROR HY000: Can't get hostname for your
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	1
+select * from performance_schema.host_cache;
 ERROR HY000: Can't get hostname for your address
 show global status like "%peer%";
 Variable_name	Value
 Peer_address_errors	2
+select * from performance_schema.host_cache;
 set global debug= default;
 flush status;
 show global status like "%peer%";

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result	2012-01-02 10:37:56 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result	2012-01-10 21:02:53 +0000
@@ -24,40 +24,40 @@ ERROR 1050 (42S01) at line 322: Table 'f
 ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
 ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 409: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 418: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 432: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 442: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 452: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 469: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 478: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 489: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 497: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 542: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 586: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 665: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 685: Table 'threads' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 717: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 733: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 759: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 772: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 798: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 842: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 886: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 994: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1059: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1090: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1099: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1108: Table 'users' already exists
-ERROR 1050 (42S01) at line 1118: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1538: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 416: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 425: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 439: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 449: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 459: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 485: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 496: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 504: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 549: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 593: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 672: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 692: Table 'threads' already exists
+ERROR 1050 (42S01) at line 708: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 724: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 740: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 793: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 805: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 849: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 893: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 937: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 969: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1001: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1033: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1097: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1106: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1115: Table 'users' already exists
+ERROR 1050 (42S01) at line 1125: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1545: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -86,40 +86,40 @@ ERROR 1050 (42S01) at line 322: Table 'f
 ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
 ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 409: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 418: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 432: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 442: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 452: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 469: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 478: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 489: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 497: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 542: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 586: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 665: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 685: Table 'threads' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 717: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 733: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 759: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 772: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 798: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 842: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 886: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 994: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1059: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1090: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1099: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1108: Table 'users' already exists
-ERROR 1050 (42S01) at line 1118: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1538: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 416: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 425: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 439: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 449: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 459: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 485: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 496: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 504: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 549: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 593: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 672: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 692: Table 'threads' already exists
+ERROR 1050 (42S01) at line 708: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 724: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 740: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 793: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 805: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 849: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 893: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 937: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 969: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1001: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1033: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1097: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1106: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1115: Table 'users' already exists
+ERROR 1050 (42S01) at line 1125: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1545: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -146,40 +146,40 @@ ERROR 1050 (42S01) at line 322: Table 'f
 ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
 ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 409: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 418: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 432: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 442: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 452: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 469: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 478: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 489: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 497: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 542: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 586: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 665: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 685: Table 'threads' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 717: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 733: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 759: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 772: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 798: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 842: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 886: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 994: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1059: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1090: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1099: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1108: Table 'users' already exists
-ERROR 1050 (42S01) at line 1118: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1538: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 416: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 425: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 439: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 449: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 459: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 485: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 496: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 504: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 549: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 593: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 672: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 692: Table 'threads' already exists
+ERROR 1050 (42S01) at line 708: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 724: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 740: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 793: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 805: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 849: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 893: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 937: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 969: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1001: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1033: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1097: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1106: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1115: Table 'users' already exists
+ERROR 1050 (42S01) at line 1125: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1545: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -206,40 +206,40 @@ ERROR 1050 (42S01) at line 322: Table 'f
 ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
 ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 409: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 418: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 432: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 442: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 452: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 469: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 478: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 489: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 497: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 542: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 586: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 665: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 685: Table 'threads' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 717: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 733: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 759: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 772: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 798: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 842: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 886: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 994: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1059: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1090: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1099: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1108: Table 'users' already exists
-ERROR 1050 (42S01) at line 1118: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1538: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 416: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 425: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 439: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 449: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 459: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 485: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 496: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 504: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 549: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 593: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 672: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 692: Table 'threads' already exists
+ERROR 1050 (42S01) at line 708: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 724: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 740: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 793: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 805: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 849: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 893: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 937: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 969: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1001: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1033: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1097: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1106: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1115: Table 'users' already exists
+ERROR 1050 (42S01) at line 1125: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1545: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -266,40 +266,40 @@ ERROR 1050 (42S01) at line 322: Table 'f
 ERROR 1050 (42S01) at line 335: Table 'socket_instances' already exists
 ERROR 1050 (42S01) at line 365: Table 'socket_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 394: Table 'socket_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 409: Table 'host_cache' already exists
-ERROR 1050 (42S01) at line 418: Table 'mutex_instances' already exists
-ERROR 1050 (42S01) at line 432: Table 'objects_summary_global_by_type' already exists
-ERROR 1050 (42S01) at line 442: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 452: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 461: Table 'setup_actors' already exists
-ERROR 1050 (42S01) at line 469: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 478: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 489: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 497: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 542: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 586: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 665: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 685: Table 'threads' already exists
-ERROR 1050 (42S01) at line 701: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 717: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 733: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 746: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 759: Table 'events_stages_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 772: Table 'events_stages_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 786: Table 'events_stages_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 798: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 842: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 886: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 930: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 962: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 994: Table 'events_statements_summary_by_host_by_event_name' already exists
-ERROR 1050 (42S01) at line 1026: Table 'events_statements_summary_by_user_by_event_name' already exists
-ERROR 1050 (42S01) at line 1059: Table 'events_statements_summary_by_account_by_event_name' already exists
-ERROR 1050 (42S01) at line 1090: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 1099: Table 'hosts' already exists
-ERROR 1050 (42S01) at line 1108: Table 'users' already exists
-ERROR 1050 (42S01) at line 1118: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1538: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 416: Table 'host_cache' already exists
+ERROR 1050 (42S01) at line 425: Table 'mutex_instances' already exists
+ERROR 1050 (42S01) at line 439: Table 'objects_summary_global_by_type' already exists
+ERROR 1050 (42S01) at line 449: Table 'performance_timers' already exists
+ERROR 1050 (42S01) at line 459: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 468: Table 'setup_actors' already exists
+ERROR 1050 (42S01) at line 476: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 485: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 496: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 504: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 549: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 593: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 672: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 692: Table 'threads' already exists
+ERROR 1050 (42S01) at line 708: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 724: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 740: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 753: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 766: Table 'events_stages_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 779: Table 'events_stages_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 793: Table 'events_stages_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 805: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 849: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 893: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 937: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 969: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 1001: Table 'events_statements_summary_by_host_by_event_name' already exists
+ERROR 1050 (42S01) at line 1033: Table 'events_statements_summary_by_user_by_event_name' already exists
+ERROR 1050 (42S01) at line 1066: Table 'events_statements_summary_by_account_by_event_name' already exists
+ERROR 1050 (42S01) at line 1097: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 1106: Table 'hosts' already exists
+ERROR 1050 (42S01) at line 1115: Table 'users' already exists
+ERROR 1050 (42S01) at line 1125: Table 'accounts' already exists
+ERROR 1644 (HY000) at line 1545: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/schema.result'
--- a/mysql-test/suite/perfschema/r/schema.result	2012-01-02 10:37:56 +0000
+++ b/mysql-test/suite/perfschema/r/schema.result	2012-01-10 21:02:53 +0000
@@ -646,13 +646,20 @@ Table	Create Table
 host_cache	CREATE TABLE `host_cache` (
   `IP` varchar(64) NOT NULL,
   `HOST` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+  `HOST_VALIDATED` enum('YES','NO') NOT NULL,
   `SUM_BLOCKING_ERRORS` bigint(20) NOT NULL,
-  `COUNT_NAMEINFO_ERRORS` bigint(20) NOT NULL,
+  `COUNT_NAMEINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL,
+  `COUNT_NAMEINFO_PERMANENT_ERRORS` bigint(20) NOT NULL,
   `COUNT_FORMAT_ERRORS` bigint(20) NOT NULL,
-  `COUNT_ADDRINFO_ERRORS` bigint(20) NOT NULL,
+  `COUNT_ADDRINFO_TRANSIENT_ERRORS` bigint(20) NOT NULL,
+  `COUNT_ADDRINFO_PERMANENT_ERRORS` bigint(20) NOT NULL,
   `COUNT_FCRDNS_ERRORS` bigint(20) NOT NULL,
   `COUNT_HOST_ACL_ERRORS` bigint(20) NOT NULL,
-  `COUNT_USER_ACL_ERRORS` bigint(20) NOT NULL
+  `COUNT_HANDSHAKE_ERRORS` bigint(20) NOT NULL,
+  `COUNT_AUTHENTICATION_ERRORS` bigint(20) NOT NULL,
+  `COUNT_USER_ACL_ERRORS` bigint(20) NOT NULL,
+  `COUNT_LOCAL_ERRORS` bigint(20) NOT NULL,
+  `COUNT_UNKNOWN_ERRORS` bigint(20) NOT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
 show create table hosts;
 Table	Create Table

=== modified file 'mysql-test/suite/perfschema/r/table_schema.result'
--- a/mysql-test/suite/perfschema/r/table_schema.result	2012-01-02 10:37:56 +0000
+++ b/mysql-test/suite/perfschema/r/table_schema.result	2012-01-10 21:02:53 +0000
@@ -471,13 +471,20 @@ def	performance_schema	hosts	CURRENT_CON
 def	performance_schema	hosts	TOTAL_CONNECTIONS	3	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
 def	performance_schema	host_cache	IP	1	NULL	NO	varchar	64	192	NULL	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
 def	performance_schema	host_cache	HOST	2	NULL	YES	varchar	255	765	NULL	NULL	NULL	utf8	utf8_bin	varchar(255)			select,insert,update,references	
-def	performance_schema	host_cache	SUM_BLOCKING_ERRORS	3	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	host_cache	COUNT_NAMEINFO_ERRORS	4	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	host_cache	COUNT_FORMAT_ERRORS	5	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	host_cache	COUNT_ADDRINFO_ERRORS	6	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	host_cache	COUNT_FCRDNS_ERRORS	7	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	host_cache	COUNT_HOST_ACL_ERRORS	8	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
-def	performance_schema	host_cache	COUNT_USER_ACL_ERRORS	9	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	HOST_VALIDATED	3	NULL	NO	enum	3	9	NULL	NULL	NULL	utf8	utf8_general_ci	enum('YES','NO')			select,insert,update,references	
+def	performance_schema	host_cache	SUM_BLOCKING_ERRORS	4	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_NAMEINFO_TRANSIENT_ERRORS	5	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_NAMEINFO_PERMANENT_ERRORS	6	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_FORMAT_ERRORS	7	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_ADDRINFO_TRANSIENT_ERRORS	8	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_ADDRINFO_PERMANENT_ERRORS	9	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_FCRDNS_ERRORS	10	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_HOST_ACL_ERRORS	11	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_HANDSHAKE_ERRORS	12	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_AUTHENTICATION_ERRORS	13	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_USER_ACL_ERRORS	14	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_LOCAL_ERRORS	15	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
+def	performance_schema	host_cache	COUNT_UNKNOWN_ERRORS	16	NULL	NO	bigint	NULL	NULL	19	0	NULL	NULL	NULL	bigint(20)			select,insert,update,references	
 def	performance_schema	mutex_instances	NAME	1	NULL	NO	varchar	128	384	NULL	NULL	NULL	utf8	utf8_general_ci	varchar(128)			select,insert,update,references	
 def	performance_schema	mutex_instances	OBJECT_INSTANCE_BEGIN	2	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	performance_schema	mutex_instances	LOCKED_BY_THREAD_ID	3	NULL	YES	int	NULL	NULL	10	0	NULL	NULL	NULL	int(11)			select,insert,update,references	

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_allow.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -14,6 +15,10 @@
 # - the host_cache records the failing IP and hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -34,22 +39,20 @@ disconnect con1;
 set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
 
 --disable_query_log
---error ER_BAD_HOST_ERROR
+--error ER_HOST_NOT_PRIVILEGED
 connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
---error ER_BAD_HOST_ERROR
+--error ER_HOST_NOT_PRIVILEGED
 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 drop user 'root'@'santa.claus.ipv4.example.com';

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_again_deny.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -14,6 +15,10 @@
 # - the host_cache records the failing IP and hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -32,22 +37,20 @@ disconnect con1;
 set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
 
 --disable_query_log
---error ER_BAD_HOST_ERROR
+--error ER_HOST_NOT_PRIVILEGED
 connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
---error ER_BAD_HOST_ERROR
+--error ER_HOST_NOT_PRIVILEGED
 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== added file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_allow.test	2012-01-10 21:02:53 +0000
@@ -0,0 +1,74 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# FIXME
+# Test scenario: (con2)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can be obtained
+# - the client IPv4 is not in the cache
+# - the client hostname can be obtained
+# - IPs for that hostname can be obtained
+# - none of the IPs match the client IP
+# - there are grants for the client IP
+# Test results:
+# - connection is accepted
+# - user is authorized by IP
+# - peer_addr_errors is unchanged
+# - the host_cache records the failing IP with no hostname
+#
+# Test scenario: (con3)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can be obtained
+# - the client IPv4 is in the cache with no hostname
+# - there are grants for the client IP
+# Test results:
+# - connection is accepted
+# - user is authorized by IP
+# - peer_addr_errors is unchanged
+# - the host_cache is unchanged
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# [Warning] IP address '192.0.2.4' could not be resolved:
+# no reverse address mapping.
+# call mtr.add_suppression("192.0.2.4");
+
+flush status;
+flush hosts;
+select @@global.debug;
+show global status like "%peer%";
+
+grant select on test.* to 'root'@'192.0.2.4';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
+
+connect (con2,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con2 is alive";
+select current_user();
+disconnect con2;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con3 is alive";
+select current_user();
+disconnect con3;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+revoke select on test.* from 'root'@'192.0.2.4';
+drop user 'root'@'192.0.2.4';
+
+set global debug= default;
+

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_bad_deny.test	2012-01-10 21:02:53 +0000
@@ -2,21 +2,37 @@
 #
 # Tests for the performance_schema host_cache.
 #
-# Test scenario:
+# FIXME
+# Test scenario: (con2)
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
+# - the client IPv4 is not in the cache
 # - the client hostname can be obtained
-# - IP for that hostname can not be obtained
+# - IPs for that hostname can be obtained
+# - none of the IPs match the client IP
 # - there are no grants for the client IP
 # Test results:
 # - connection is refused
-# - peer_addr_error is unchanged
-# - the host_cache records the failing IP and hostname
+# - peer_addr_errors is unchanged
+# - the host_cache records the failing IP with no hostname
 #
+# Test scenario: (con3)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can be obtained
+# - the client IPv4 is in the cache with no hostname
+# - there are no grants for the client IP
+# Test results:
+# - connection is refused
+# - peer_addr_errors is unchanged
+# - the host_cache is unchanged
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
 
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
-call mtr.add_suppression("192.0.2.4");
+# call mtr.add_suppression("192.0.2.4");
 
 flush status;
 flush hosts;
@@ -37,8 +53,7 @@ connect (con2,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_HOST_NOT_PRIVILEGED
@@ -46,8 +61,7 @@ connect (con3,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_allow.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -14,6 +15,10 @@
 # - the host_cache records the failing IP and hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -39,8 +44,7 @@ select current_user();
 disconnect con2;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 select "Con3 is alive";
@@ -48,8 +52,7 @@ select current_user();
 disconnect con3;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 drop user 'root'@'santa.claus.ipv4.example.com';

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_good_deny.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -14,6 +15,10 @@
 # - the host_cache records the failing IP and hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -37,8 +42,7 @@ connect (con2,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_HOST_NOT_PRIVILEGED
@@ -46,8 +50,7 @@ connect (con3,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_allow.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -14,6 +15,10 @@
 # - the host_cache records the failing IP and hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -40,8 +45,7 @@ select current_user();
 disconnect con2;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 select "Con3 is alive";
@@ -49,8 +53,7 @@ select current_user();
 disconnect con3;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 revoke select on test.* from 'root'@'192.0.2.4';

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_addrinfo_noname_deny.test	2012-01-10 21:02:53 +0000
@@ -2,18 +2,23 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
 # - the client hostname can be obtained
-# - IP for that hostname can not be obtained
+# - IP for that hostname can not be obtained (NONAME)
 # - there are no grants for the client IP
 # Test results:
 # - connection is refused
 # - peer_addr_error is unchanged
-# - the host_cache records the failing IP and hostname
+# - the host_cache records the failing IP without hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -37,8 +42,7 @@ connect (con2,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_HOST_NOT_PRIVILEGED
@@ -46,8 +50,7 @@ connect (con3,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_format.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_format.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -14,6 +15,10 @@
 # - the host_cache records the failing IP with hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # Name or service not known
 call mtr.add_suppression("192.0.2.4");
@@ -37,8 +42,7 @@ connect (con2,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_HOST_NOT_PRIVILEGED
@@ -46,8 +50,7 @@ connect (con3,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_allow.test	2012-01-10 21:02:53 +0000
@@ -2,16 +2,58 @@
 #
 # Tests for the performance_schema host_cache.
 #
-# Test scenario:
+# FIXME
+# Test scenario: (con2)
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained (temp failure)
+# - the client IPv4 is not in the cache
 # - the client hostname can not be obtained
 # - there are grants for the client IP
 # Test results:
 # - connection is accepted
+# - user is authorized by IP
 # - peer_addr_error is unchanged
 # - the host_cache records the failing IP with no hostname
 #
+# Test scenario: (con3)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can be obtained (temp failure)
+# - the client IPv4 is in the cache with no hostname
+# - the client hostname can not be obtained
+# - there are grants for the client IP
+# Test results:
+# - connection is accepted
+# - user is authorized by IP
+# - peer_addr_error is unchanged
+# - the host_cache records the failing IP with no hostname
+#
+# Test scenario: (con4)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can be obtained
+# - the client IPv4 is in the cache with no hostname
+# - the client hostname can be obtained, finally
+# - there are grants for the client host
+# Test results:
+# - connection is accepted
+# - user is authorized by hostname
+# - peer_addr_errors is unchanged
+# - the host_cache is updated with the resolved hostname
+#
+# Test scenario: (con5)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can be obtained
+# - the client IPv4 is in the cache with resolved hostname
+# - there are grants for the client host
+# Test results:
+# - connection is accepted
+# - user is authorized by hostname
+# - peer_addr_errors is unchanged
+# - the host_cache is unchanged
+#
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
 
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # Temporary failure in name resolution
@@ -23,6 +65,7 @@ select @@global.debug;
 show global status like "%peer%";
 
 grant select on test.* to 'root'@'192.0.2.4';
+grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
 
 connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 select "Con1 is alive";
@@ -38,8 +81,7 @@ select current_user();
 disconnect con2;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 select "Con3 is alive";
@@ -47,11 +89,30 @@ select current_user();
 disconnect con3;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
+
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+connect (con4,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con4 is alive";
+select current_user();
+disconnect con4;
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+connect (con5,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con5 is alive";
+select current_user();
+disconnect con5;
+
+--connection default
+--source ../include/hostcache_dump.inc
 
 revoke select on test.* from 'root'@'192.0.2.4';
+revoke select on test.* from 'root'@'santa.claus.ipv4.example.com';
 drop user 'root'@'192.0.2.4';
+drop user 'root'@'santa.claus.ipv4.example.com';
 
 set global debug= default;
 

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_again_deny.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario: (con2)
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -46,6 +47,10 @@
 # - the host_cache is unchanged
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # Temporary failure in name resolution
 call mtr.add_suppression("192.0.2.4");
@@ -69,8 +74,7 @@ connect (con2,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_HOST_NOT_PRIVILEGED
@@ -78,8 +82,7 @@ connect (con3,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
 
@@ -89,8 +92,7 @@ connect (con4,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_HOST_NOT_PRIVILEGED
@@ -98,9 +100,7 @@ connect (con5,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
-
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_allow.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -14,6 +15,10 @@
 # - the host_cache records the failing IP with no hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -39,8 +44,7 @@ select current_user();
 disconnect con2;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 connect (con3,"127.0.0.1",root,,test,$MASTER_MYPORT,);
 select "Con3 is alive";
@@ -48,8 +52,7 @@ select current_user();
 disconnect con3;
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 revoke select on test.* from 'root'@'192.0.2.4';
 drop user 'root'@'192.0.2.4';

=== modified file 'mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_nameinfo_noname_deny.test	2012-01-10 21:02:53 +0000
@@ -2,6 +2,7 @@
 #
 # Tests for the performance_schema host_cache.
 #
+# FIXME
 # Test scenario:
 # - a client connects on a TCP/IPv4 socket
 # - the client IPv4 can be obtained
@@ -13,6 +14,10 @@
 # - the host_cache records the failing IP with no hostname
 #
 
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
 # [Warning] IP address '192.0.2.4' could not be resolved:
 # no reverse address mapping.
 call mtr.add_suppression("192.0.2.4");
@@ -36,8 +41,7 @@ connect (con2,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_HOST_NOT_PRIVILEGED
@@ -45,8 +49,7 @@ connect (con3,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
-select * from performance_schema.host_cache;
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== modified file 'mysql-test/suite/perfschema/t/hostcache_peer_addr.test'
--- a/mysql-test/suite/perfschema/t/hostcache_peer_addr.test	2012-01-10 09:35:16 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_peer_addr.test	2012-01-10 21:02:53 +0000
@@ -2,14 +2,26 @@
 #
 # Tests for the performance_schema host_cache.
 #
-# Test scenario:
-# - a client connects on a TCP socket
-# - the client IP can not be obtained
+# Test scenario: (con2)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can not be obtained
 # Test results:
 # - connection is refused
 # - peer_addr_errors is incremented
 # - the host_cache is unchanged
 #
+# Test scenario: (con3)
+# - a client connects on a TCP/IPv4 socket
+# - the client IPv4 can not be obtained
+# Test results:
+# - connection is refused
+# - peer_addr_errors is incremented
+# - the host_cache is unchanged
+#
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
 
 flush status;
 flush hosts;
@@ -30,7 +42,7 @@ connect (con2,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
+--source ../include/hostcache_dump.inc
 
 --disable_query_log
 --error ER_BAD_HOST_ERROR
@@ -38,7 +50,7 @@ connect (con3,"127.0.0.1",root,,test,$MA
 --enable_query_log
 
 --connection default
-show global status like "%peer%";
+--source ../include/hostcache_dump.inc
 
 set global debug= default;
 

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2012-01-02 10:37:56 +0000
+++ b/scripts/mysql_system_tables.sql	2012-01-10 21:02:53 +0000
@@ -610,13 +610,20 @@ DROP PREPARE stmt;
 SET @cmd="CREATE TABLE performance_schema.host_cache("
   "IP VARCHAR(64) not null,"
   "HOST VARCHAR(255) collate utf8_bin,"
+  "HOST_VALIDATED ENUM ('YES', 'NO') not null,"
   "SUM_BLOCKING_ERRORS BIGINT not null,"
-  "COUNT_NAMEINFO_ERRORS BIGINT not null,"
+  "COUNT_NAMEINFO_TRANSIENT_ERRORS BIGINT not null,"
+  "COUNT_NAMEINFO_PERMANENT_ERRORS BIGINT not null,"
   "COUNT_FORMAT_ERRORS BIGINT not null,"
-  "COUNT_ADDRINFO_ERRORS BIGINT not null,"
+  "COUNT_ADDRINFO_TRANSIENT_ERRORS BIGINT not null,"
+  "COUNT_ADDRINFO_PERMANENT_ERRORS BIGINT not null,"
   "COUNT_FCRDNS_ERRORS BIGINT not null,"
   "COUNT_HOST_ACL_ERRORS BIGINT not null,"
-  "COUNT_USER_ACL_ERRORS BIGINT not null"
+  "COUNT_HANDSHAKE_ERRORS BIGINT not null,"
+  "COUNT_AUTHENTICATION_ERRORS BIGINT not null,"
+  "COUNT_USER_ACL_ERRORS BIGINT not null,"
+  "COUNT_LOCAL_ERRORS BIGINT not null,"
+  "COUNT_UNKNOWN_ERRORS BIGINT not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');

=== modified file 'sql/hostname.cc'
--- a/sql/hostname.cc	2012-01-10 09:35:16 +0000
+++ b/sql/hostname.cc	2012-01-10 21:02:53 +0000
@@ -47,8 +47,18 @@ extern "C" {					// Because of SCO 3.2V4
 #endif
 
 Host_errors::Host_errors()
-: m_nameinfo_errors(0), m_format_errors(0),
-  m_addrinfo_errors(0), m_FCrDNS_errors(0)
+: m_nameinfo_transient_errors(0),
+  m_nameinfo_permanent_errors(0),
+  m_format_errors(0),
+  m_addrinfo_transient_errors(0),
+  m_addrinfo_permanent_errors(0),
+  m_FCrDNS_errors(0),
+  m_host_acl_errors(0),
+  m_handshake_errors(0),
+  m_authentication_errors(0),
+  m_user_acl_errors(0),
+  m_local_errors(0),
+  m_unknown_errors(0)
 {}
     
 Host_errors::~Host_errors()
@@ -56,24 +66,43 @@ Host_errors::~Host_errors()
 
 void Host_errors::reset()
 {
-  m_nameinfo_errors= 0;
+  m_nameinfo_transient_errors= 0;
+  m_nameinfo_permanent_errors= 0;
   m_format_errors= 0;
-  m_addrinfo_errors= 0;
+  m_addrinfo_transient_errors= 0;
+  m_addrinfo_permanent_errors= 0;
   m_FCrDNS_errors= 0;
+  m_host_acl_errors= 0;
+  m_handshake_errors= 0;
+  m_authentication_errors= 0;
+  m_user_acl_errors= 0;
+  m_local_errors= 0;
+  m_unknown_errors= 0;
 }
 
 uint Host_errors::get_blocking_errors()
 {
-  // FIXME
-  return m_nameinfo_errors;
+  uint blocking= 0;
+  blocking+= m_host_acl_errors;
+  blocking+= m_authentication_errors;
+  blocking+= m_user_acl_errors;
+  return blocking;
 }
 
 void Host_errors::aggregate(const Host_errors *errors)
 {
-  m_nameinfo_errors+= errors->m_nameinfo_errors;
+  m_nameinfo_transient_errors+= errors->m_nameinfo_transient_errors;
+  m_nameinfo_permanent_errors+= errors->m_nameinfo_permanent_errors;
   m_format_errors+= errors->m_format_errors;
-  m_addrinfo_errors+= errors->m_addrinfo_errors;
+  m_addrinfo_transient_errors+= errors->m_addrinfo_transient_errors;
+  m_addrinfo_permanent_errors+= errors->m_addrinfo_permanent_errors;
   m_FCrDNS_errors+= errors->m_FCrDNS_errors;
+  m_host_acl_errors+= errors->m_host_acl_errors;
+  m_handshake_errors+= errors->m_handshake_errors;
+  m_authentication_errors+= errors->m_authentication_errors;
+  m_user_acl_errors+= errors->m_user_acl_errors;
+  m_local_errors+= errors->m_local_errors;
+  m_unknown_errors+= errors->m_unknown_errors;
 }
 
 static hash_filo *hostname_cache;
@@ -162,6 +191,7 @@ static bool add_hostname_impl(const char
     memcpy(&entry->ip_key, ip_key, HOST_ENTRY_KEY_SIZE);
     entry->m_errors.reset();
     entry->m_hostname_length= 0;
+    entry->m_host_validated= false;
   }
 
   if (validated)
@@ -175,17 +205,29 @@ static bool add_hostname_impl(const char
       entry->m_hostname[len]= '\0';
       entry->m_hostname_length= len;
 
-      DBUG_PRINT("info", ("Adding/Updating '%s' -> '%s' to the hostname cache...'",
-                          (const char *) ip_key,
-                          (const char *) entry->m_hostname));
+      DBUG_PRINT("info",
+                 ("Adding/Updating '%s' -> '%s' (validated) to the hostname cache...'",
+                 (const char *) ip_key,
+                 (const char *) entry->m_hostname));
     }
     else
     {
       entry->m_hostname_length= 0;
-
-      DBUG_PRINT("info", ("Adding/Updating '%s' -> empty to the hostname cache...'",
-                          (const char *) ip_key));
+      DBUG_PRINT("info",
+                 ("Adding/Updating '%s' -> NULL (validated) to the hostname cache...'",
+                 (const char *) ip_key));
     }
+    entry->m_host_validated= true;
+  }
+  else
+  {
+    entry->m_hostname_length= 0;
+    /* There are currently no use cases that invalidate an entry. */
+    DBUG_ASSERT(! entry->m_host_validated);
+    entry->m_host_validated= false;
+    DBUG_PRINT("info",
+               ("Adding/Updating '%s' -> NULL (not validated) to the hostname cache...'",
+               (const char *) ip_key));
   }
 
   entry->m_errors.aggregate(errors);
@@ -359,21 +401,29 @@ bool ip_to_hostname(struct sockaddr_stor
 
     if (entry)
     {
-      *connect_errors= entry->m_errors.get_blocking_errors();
-      *hostname= NULL;
-
-      if (entry->m_hostname_length)
-        *hostname= my_strdup(entry->m_hostname, MYF(0));
-
-      DBUG_PRINT("info",("IP (%s) has been found in the cache. "
-                         "Hostname: '%s'; connect_errors: %d",
-                         (const char *) ip_key,
-                         (const char *) (*hostname? *hostname : "null"),
-                         (int) *connect_errors));
+      /*
+        If there is an IP -> HOSTNAME association in the cache,
+        but for a hostname that was not validated,
+        do not return that hostname: perform the network validation again.
+      */
+      if (entry->m_host_validated)
+      {
+        *connect_errors= entry->m_errors.get_blocking_errors();
+        *hostname= NULL;
+
+        if (entry->m_hostname_length)
+          *hostname= my_strdup(entry->m_hostname, MYF(0));
+
+        DBUG_PRINT("info",("IP (%s) has been found in the cache. "
+                           "Hostname: '%s'; connect_errors: %d",
+                           (const char *) ip_key,
+                           (const char *) (*hostname? *hostname : "null"),
+                           (int) *connect_errors));
 
-      mysql_mutex_unlock(&hostname_cache->lock);
+        mysql_mutex_unlock(&hostname_cache->lock);
 
-      DBUG_RETURN(FALSE);
+        DBUG_RETURN(FALSE);
+      }
     }
 
     mysql_mutex_unlock(&hostname_cache->lock);
@@ -598,6 +648,17 @@ bool ip_to_hostname(struct sockaddr_stor
 
   if (err_code == EAI_NONAME)
   {
+    errors.m_addrinfo_permanent_errors= 1;
+    err_status= add_hostname(ip_key, NULL, true, &errors);
+
+    *hostname= NULL;
+    *connect_errors= 0; /* New IP added to the cache. */
+
+    DBUG_RETURN(FALSE);
+  }
+
+  if (err_code)
+  {
     /*
       Don't cache responses when the DNS server is down, as otherwise
       transient DNS failure may leave any number of clients (those
@@ -605,18 +666,13 @@ bool ip_to_hostname(struct sockaddr_stor
       indefinitely.
     */
 
-    errors.m_addrinfo_errors= 1;
+    errors.m_addrinfo_transient_errors= 1;
     err_status= add_hostname(ip_key, NULL, false, &errors);
 
     *hostname= NULL;
     *connect_errors= 0; /* New IP added to the cache. */
 
-    DBUG_RETURN(err_status);
-  }
-  else if (err_code)
-  {
-    DBUG_PRINT("error", ("getaddrinfo() failed with error code %d.", err_code));
-    DBUG_RETURN(TRUE);
+    DBUG_RETURN(FALSE);
   }
 
   /* Check that getaddrinfo() returned the used IP (FCrDNS technique). */

=== modified file 'sql/hostname.h'
--- a/sql/hostname.h	2012-01-10 09:35:16 +0000
+++ b/sql/hostname.h	2012-01-10 21:02:53 +0000
@@ -35,18 +35,30 @@ public:
   /** Number of blocking errors. */
   uint get_blocking_errors();
 
-  /** Number of errors from getnameinfo(). */
-  uint m_nameinfo_errors;
+  /** Number of transient errors from getnameinfo(). */
+  uint m_nameinfo_transient_errors;
+  /** Number of permanent errors from getnameinfo(). */
+  uint m_nameinfo_permanent_errors;
   /** Number of errors from is_hostname_valid(). */
   uint m_format_errors;
-  /** Number of errors from getaddrinfo(). */
-  uint m_addrinfo_errors;
-  /** Number of errors from Forward-confirmed reverse DNS checks. */
+  /** Number of transient errors from getaddrinfo(). */
+  uint m_addrinfo_transient_errors;
+  /** Number of permanent errors from getaddrinfo(). */
+  uint m_addrinfo_permanent_errors;
+  /** Number of errors from Forward-Confirmed reverse DNS checks. */
   uint m_FCrDNS_errors;
-  /** Number of errors from authentication. */
-  uint m_handshake_errors;
   /** Number of errors from host grants. */
   uint m_host_acl_errors;
+  /** Number of errors from authentication plugins. */
+  uint m_handshake_errors;
+  /** Number of errors from authentication. */
+  uint m_authentication_errors;
+  /** Number of errors from user grants. */
+  uint m_user_acl_errors;
+  /** Number of errors from the server itself. */
+  uint m_local_errors;
+  /** Number of unknown errors. */
+  uint m_unknown_errors;
 };
 
 /** Size of IP address string in the hash cache. */
@@ -84,6 +96,8 @@ public:
   char m_hostname[HOSTNAME_LENGTH + 1];
   /** Length in bytes of @c m_hostname. */
   uint m_hostname_length;
+  /** The hostname is validated and used for authorization. */
+  bool m_host_validated;
   /** Error statistics. */
   Host_errors m_errors;
 };

=== modified file 'storage/perfschema/pfs_engine_table.cc'
--- a/storage/perfschema/pfs_engine_table.cc	2012-01-02 10:37:56 +0000
+++ b/storage/perfschema/pfs_engine_table.cc	2012-01-10 21:02:53 +0000
@@ -153,7 +153,7 @@ void PFS_engine_table_share::check_all_t
   DBUG_EXECUTE_IF("tampered_perfschema_table1",
                   {
                     /* Hack SETUP_INSTRUMENT, incompatible change. */
-                    all_shares[17]->m_field_def->count++;
+                    all_shares[20]->m_field_def->count++;
                   });
 
   for (current= &all_shares[0]; (*current) != NULL; current++)

=== modified file 'storage/perfschema/table_host_cache.cc'
--- a/storage/perfschema/table_host_cache.cc	2012-01-10 09:35:16 +0000
+++ b/storage/perfschema/table_host_cache.cc	2012-01-10 21:02:53 +0000
@@ -38,12 +38,22 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
   {
+    { C_STRING_WITH_LEN("HOST_VALIDATED") },
+    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
+    { NULL, 0}
+  },
+  {
     { C_STRING_WITH_LEN("SUM_BLOCKING_ERRORS") },
     { C_STRING_WITH_LEN("bigint(20)") },
     { NULL, 0}
   },
   {
-    { C_STRING_WITH_LEN("COUNT_NAMEINFO_ERRORS") },
+    { C_STRING_WITH_LEN("COUNT_NAMEINFO_TRANSIENT_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_NAMEINFO_PERMANENT_ERRORS") },
     { C_STRING_WITH_LEN("bigint(20)") },
     { NULL, 0}
   },
@@ -53,7 +63,12 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
   {
-    { C_STRING_WITH_LEN("COUNT_ADDRINFO_ERRORS") },
+    { C_STRING_WITH_LEN("COUNT_ADDRINFO_TRANSIENT_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_ADDRINFO_PERMANENT_ERRORS") },
     { C_STRING_WITH_LEN("bigint(20)") },
     { NULL, 0}
   },
@@ -68,15 +83,45 @@ static const TABLE_FIELD_TYPE field_type
     { NULL, 0}
   },
   {
+    { C_STRING_WITH_LEN("COUNT_FCRDNS_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_HOST_ACL_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_HANDSHAKE_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_AUTHENTICATION_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
     { C_STRING_WITH_LEN("COUNT_USER_ACL_ERRORS") },
     { C_STRING_WITH_LEN("bigint(20)") },
     { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_LOCAL_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_UNKNOWN_ERRORS") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
   }
 };
 
 TABLE_FIELD_DEF
 table_host_cache::m_field_def=
-{ 9, field_types };
+{ 16, field_types };
 
 PFS_engine_table_share
 table_host_cache::m_share=
@@ -165,13 +210,20 @@ void table_host_cache::make_row(Host_ent
   row->m_hostname_length= entry->m_hostname_length;
   if (row->m_hostname_length > 0)
     strncpy(row->m_hostname, entry->m_hostname, row->m_hostname_length);
+  row->m_host_validated= entry->m_host_validated;
   row->m_sum_blocking_errors= entry->m_errors.get_blocking_errors();
-  row->m_count_nameinfo_errors= entry->m_errors.m_nameinfo_errors;
+  row->m_count_nameinfo_transient_errors= entry->m_errors.m_nameinfo_transient_errors;
+  row->m_count_nameinfo_permanent_errors= entry->m_errors.m_nameinfo_permanent_errors;
   row->m_count_format_errors= entry->m_errors.m_format_errors;
-  row->m_count_addrinfo_errors= entry->m_errors.m_addrinfo_errors;
+  row->m_count_addrinfo_transient_errors= entry->m_errors.m_addrinfo_transient_errors;
+  row->m_count_addrinfo_permanent_errors= entry->m_errors.m_addrinfo_permanent_errors;
   row->m_count_fcrdns_errors= entry->m_errors.m_FCrDNS_errors;
-  row->m_count_host_acl_errors= 12; // FIXME
-  row->m_count_user_acl_errors= 12; // FIXME
+  row->m_count_host_acl_errors= entry->m_errors.m_host_acl_errors;
+  row->m_count_handshake_errors= entry->m_errors.m_handshake_errors;
+  row->m_count_authentication_errors= entry->m_errors.m_authentication_errors;
+  row->m_count_user_acl_errors= entry->m_errors.m_user_acl_errors;
+  row->m_count_local_errors= entry->m_errors.m_local_errors;
+  row->m_count_unknown_errors= entry->m_errors.m_unknown_errors;
 }
 
 void table_host_cache::reset_position(void)
@@ -237,27 +289,48 @@ int table_host_cache::read_row_values(TA
         else
           f->set_null();
         break;
-      case 2: /* SUM_BLOCKING_ERRORS */
+      case 2: /* HOST_VALIDATED */
+        set_field_enum(f, m_row->m_host_validated ? ENUM_YES : ENUM_NO);
+        break;
+      case 3: /* SUM_BLOCKING_ERRORS */
         set_field_ulonglong(f, m_row->m_sum_blocking_errors);
         break;
-      case 3: /* COUNT_NAMEINFO_ERRORS */
-        set_field_ulonglong(f, m_row->m_count_nameinfo_errors);
+      case 4: /* COUNT_NAMEINFO_TRANSIENT_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_nameinfo_transient_errors);
+        break;
+      case 5: /* COUNT_NAMEINFO_PERSISTENT_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_nameinfo_permanent_errors);
         break;
-      case 4: /* COUNT_FORMAT_ERRORS */
+      case 6: /* COUNT_FORMAT_ERRORS */
         set_field_ulonglong(f, m_row->m_count_format_errors);
         break;
-      case 5: /* COUNT_ADDRINFO_ERRORS */
-        set_field_ulonglong(f, m_row->m_count_addrinfo_errors);
+      case 7: /* COUNT_ADDRINFO_TRANSIENT_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_addrinfo_transient_errors);
         break;
-      case 6: /* COUNT_FCRDNS_ERRORS */
+      case 8: /* COUNT_ADDRINFO_PERSISTENT_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_addrinfo_permanent_errors);
+        break;
+      case 9: /* COUNT_FCRDNS_ERRORS */
         set_field_ulonglong(f, m_row->m_count_fcrdns_errors);
         break;
-      case 7: /* COUNT_HOST_ACL_ERRORS */
+      case 10: /* COUNT_HOST_ACL_ERRORS */
         set_field_ulonglong(f, m_row->m_count_host_acl_errors);
         break;
-      case 8: /* COUNT_USER_ACL_ERRORS */
+      case 11: /* COUNT_HANDSHAKE_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_handshake_errors);
+        break;
+      case 12: /* COUNT_AUTHENTICATION_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_authentication_errors);
+        break;
+      case 13: /* COUNT_USER_ACL_ERRORS */
         set_field_ulonglong(f, m_row->m_count_user_acl_errors);
         break;
+      case 14: /* COUNT_LOCAL_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_local_errors);
+        break;
+      case 15: /* COUNT_UNKNOWN_ERRORS */
+        set_field_ulonglong(f, m_row->m_count_unknown_errors);
+        break;
       default:
         DBUG_ASSERT(false);
       }

=== modified file 'storage/perfschema/table_host_cache.h'
--- a/storage/perfschema/table_host_cache.h	2011-08-02 17:17:18 +0000
+++ b/storage/perfschema/table_host_cache.h	2012-01-10 21:02:53 +0000
@@ -34,18 +34,40 @@ class Host_entry;
 /** A row of PERFORMANCE_SCHEMA.HOST_CACHE. */
 struct row_host_cache
 {
+  /** Column IP. */
   char m_ip[64];
   uint m_ip_length;
   /** Column HOST. */
   char m_hostname[255];
   uint m_hostname_length;
+  /** Column HOST_VALIDATED. */
+  bool m_host_validated;
+  /** Column SUM_BLOCKING_ERRORS. */
   ulonglong m_sum_blocking_errors;
-  ulonglong m_count_nameinfo_errors;
+  /** Column COUNT_NAMEINFO_TRANSIENT_ERRORS. */
+  ulonglong m_count_nameinfo_transient_errors;
+  /** Column COUNT_NAMEINFO_PERMANENT_ERRORS. */
+  ulonglong m_count_nameinfo_permanent_errors;
+  /** Column COUNT_FORMAT_ERRORS. */
   ulonglong m_count_format_errors;
-  ulonglong m_count_addrinfo_errors;
+  /** Column COUNT_ADDRINFO_TRANSIENT_ERRORS. */
+  ulonglong m_count_addrinfo_transient_errors;
+  /** Column COUNT_ADDRINFO_PERMANENT_ERRORS. */
+  ulonglong m_count_addrinfo_permanent_errors;
+  /** Column COUNT_FCRDNS_ERRORS. */
   ulonglong m_count_fcrdns_errors;
+  /** Column COUNT_HOST_ACL_ERRORS. */
   ulonglong m_count_host_acl_errors;
+  /** Column COUNT_HANDSHAKE_ERRORS. */
+  ulonglong m_count_handshake_errors;
+  /** Column COUNT_AUTHENTICATION_ERRORS. */
+  ulonglong m_count_authentication_errors;
+  /** Column COUNT_USER_ACL_ERRORS. */
   ulonglong m_count_user_acl_errors;
+  /** Column COUNT_LOCAL_ERRORS. */
+  ulonglong m_count_local_errors;
+  /** Column COUNT_UNKNOWN_ERRORS. */
+  ulonglong m_count_unknown_errors;
 };
 
 /** Table PERFORMANCE_SCHEMA.HOST_CACHE. */

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5259 branch (marc.alff:3343 to 3344) Marc Alff10 Jan