List:Commits« Previous MessageNext Message »
From:Marc Alff Date:February 15 2012 12:05pm
Subject:bzr push into mysql-trunk-wl5259 branch (marc.alff:3380 to 3382)
View as plain text  
 3382 Marc Alff	2012-02-15
      More test cases

    added:
      mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
      mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
      mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
      mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
      mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test
      mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test
      mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt
      mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test
      mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt
      mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test
 3381 Marc Alff	2012-02-15 [merge]
      Merge mysql-trunk --> mysql-trunk-wl5259

    added:
      mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result
      mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test
      mysql-test/t/subquery_sj_all-master.opt
      mysql-test/t/subquery_sj_all_bka-master.opt
      mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt
      mysql-test/t/subquery_sj_all_bkaunique-master.opt
      mysql-test/t/subquery_sj_dupsweed-master.opt
      mysql-test/t/subquery_sj_dupsweed_bka-master.opt
      mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt
      mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt
      mysql-test/t/subquery_sj_firstmatch-master.opt
      mysql-test/t/subquery_sj_firstmatch_bka-master.opt
    modified:
      include/violite.h
      mysql-test/include/icp_tests.inc
      mysql-test/r/innodb_icp.result
      mysql-test/r/innodb_icp_all.result
      mysql-test/r/innodb_icp_none.result
      mysql-test/r/myisam_icp.result
      mysql-test/r/myisam_icp_all.result
      mysql-test/r/myisam_icp_none.result
      mysql-test/suite/innodb/t/innodb_bug-13628249.test
      mysql-test/suite/opt_trace/include/general.inc
      mysql-test/suite/opt_trace/include/general2.inc
      mysql-test/suite/opt_trace/include/subquery.inc
      mysql-test/suite/opt_trace/r/general2_no_prot.result
      mysql-test/suite/opt_trace/r/general2_ps_prot.result
      mysql-test/suite/opt_trace/r/general_no_prot_all.result
      mysql-test/suite/opt_trace/r/general_no_prot_none.result
      mysql-test/suite/opt_trace/r/general_ps_prot_all.result
      mysql-test/suite/opt_trace/r/general_ps_prot_none.result
      mysql-test/suite/opt_trace/r/subquery_no_prot.result
      mysql-test/suite/opt_trace/r/subquery_ps_prot.result
      mysql-test/suite/perfschema/r/threads_innodb.result
      mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result
      mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test
      sql-common/my_time.c
      sql/sql_optimizer.cc
      storage/innobase/handler/ha_innodb.cc
      storage/innobase/include/srv0srv.h
      storage/innobase/srv/srv0srv.cc
      storage/innobase/srv/srv0start.cc
      storage/innobase/trx/trx0purge.cc
      vio/vio.c
      vio/viosocket.c
 3380 Marc Alff	2012-02-14
      Timestamps changed to use a precision to the second only.

    modified:
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/table_schema.result
      scripts/mysql_system_tables.sql
=== modified file 'include/violite.h'
--- a/include/violite.h	2011-08-19 15:18:57 +0000
+++ b/include/violite.h	2012-02-15 07:20:32 +0000
@@ -54,6 +54,7 @@ enum enum_vio_io_event
 #define VIO_LOCALHOST 1                         /* a localhost connection */
 #define VIO_BUFFERED_READ 2                     /* use buffered read */
 #define VIO_READ_BUFFER_SIZE 16384              /* size of read buffer */
+#define VIO_DESCRIPTION_SIZE 30                 /* size of description */
 
 Vio* vio_new(my_socket sd, enum enum_vio_type type, uint flags);
 Vio*  mysql_socket_vio_new(MYSQL_SOCKET mysql_socket, enum enum_vio_type type, uint flags);
@@ -214,7 +215,11 @@ struct st_vio
   struct sockaddr_storage	remote;		/* Remote internet address */
   int addrLen;                          /* Length of remote address */
   enum enum_vio_type	type;		/* Type of connection */
-  char			desc[30];	/* String description */
+  char			desc[VIO_DESCRIPTION_SIZE]; /* Description string. This
+                                                      member MUST NOT be
+                                                      used directly, but only
+                                                      via function
+                                                      "vio_description" */
   char                  *read_buffer;   /* buffer for vio_read_buff */
   char                  *read_pos;      /* start of unfetched data in the
                                            read buffer */

=== modified file 'mysql-test/include/icp_tests.inc'
--- a/mysql-test/include/icp_tests.inc	2012-02-08 15:25:17 +0000
+++ b/mysql-test/include/icp_tests.inc	2012-02-14 14:42:12 +0000
@@ -1119,3 +1119,34 @@ CALL proc1(15);
 DROP PROCEDURE proc1;
 
 DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+--echo #
+
+CREATE TABLE t1 (
+  i1 INTEGER NOT NULL,
+  i2 INTEGER NOT NULL,
+  KEY (i1)
+);
+
+INSERT INTO t1 VALUES (4,4), (5,5);
+
+CREATE TABLE t2 (
+  pk INTEGER NOT NULL,
+  PRIMARY KEY (pk)
+);
+
+INSERT INTO t2 VALUES (1);
+
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+
+let query=
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+
+eval EXPLAIN $query;
+eval $query;
+
+DROP FUNCTION f1;
+DROP TABLE t1, t2;

=== modified file 'mysql-test/r/innodb_icp.result'
--- a/mysql-test/r/innodb_icp.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/innodb_icp.result	2012-02-14 14:42:12 +0000
@@ -1041,5 +1041,29 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/innodb_icp_all.result'
--- a/mysql-test/r/innodb_icp_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/innodb_icp_all.result	2012-02-14 14:42:12 +0000
@@ -1041,5 +1041,29 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/innodb_icp_none.result'
--- a/mysql-test/r/innodb_icp_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/innodb_icp_none.result	2012-02-14 14:42:12 +0000
@@ -1040,5 +1040,29 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set default_storage_engine= @save_storage_engine;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/myisam_icp.result'
--- a/mysql-test/r/myisam_icp.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/myisam_icp.result	2012-02-14 14:42:12 +0000
@@ -1036,4 +1036,28 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/myisam_icp_all.result'
--- a/mysql-test/r/myisam_icp_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/myisam_icp_all.result	2012-02-14 14:42:12 +0000
@@ -1036,4 +1036,28 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/r/myisam_icp_none.result'
--- a/mysql-test/r/myisam_icp_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/r/myisam_icp_none.result	2012-02-14 14:42:12 +0000
@@ -1035,4 +1035,28 @@ i2
 20
 DROP PROCEDURE proc1;
 DROP TABLE t1, t2;
+#
+# Bug#13655397 "CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
+#
+CREATE TABLE t1 (
+i1 INTEGER NOT NULL,
+i2 INTEGER NOT NULL,
+KEY (i1)
+);
+INSERT INTO t1 VALUES (4,4), (5,5);
+CREATE TABLE t2 (
+pk INTEGER NOT NULL,
+PRIMARY KEY (pk)
+);
+INSERT INTO t2 VALUES (1);
+CREATE FUNCTION f1() RETURNS INTEGER
+RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
+EXPLAIN SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i1	i1	4	const	1	Using where
+SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
+i1	i2
+5	5
+DROP FUNCTION f1;
+DROP TABLE t1, t2;
 set optimizer_switch=default;

=== modified file 'mysql-test/suite/innodb/t/innodb_bug-13628249.test'
--- a/mysql-test/suite/innodb/t/innodb_bug-13628249.test	2012-02-14 06:30:44 +0000
+++ b/mysql-test/suite/innodb/t/innodb_bug-13628249.test	2012-02-14 10:27:14 +0000
@@ -3,6 +3,10 @@
 # after a crash with active user tranactions.
 
 #
+# Not supported in embedded
+--source include/not_embedded.inc
+
+#
 # This test case needs to crash the server. Needs a debug server.
 --source include/have_debug.inc
 #

=== modified file 'mysql-test/suite/opt_trace/include/general.inc'
--- a/mysql-test/suite/opt_trace/include/general.inc	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/include/general.inc	2012-02-14 15:07:11 +0000
@@ -311,7 +311,7 @@ select * from information_schema.OPTIMIZ
 # HAVING
 select t1.a,avg(t2.c) as moyenne from t1, t2 where t2.c>-1
   group by t1.a having moyenne<>0;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select trace from information_schema.OPTIMIZER_TRACE;
 # impossible HAVING
 select t1.a,avg(t2.c) as moyenne from t1, t2 where t2.c>-1

=== modified file 'mysql-test/suite/opt_trace/include/general2.inc'
--- a/mysql-test/suite/opt_trace/include/general2.inc	2012-01-03 11:04:14 +0000
+++ b/mysql-test/suite/opt_trace/include/general2.inc	2012-02-14 15:07:11 +0000
@@ -156,7 +156,7 @@ SELECT t1.f2 FROM t1
 STRAIGHT_JOIN (t2 JOIN t3 ON t3.f2  = t2.f2  ) ON t3 .f2  = t2 .f2
 HAVING ('v', 'i') NOT IN (SELECT f2, MIN(f2) FROM t1)
 ORDER BY f2;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select TRACE from information_schema.OPTIMIZER_TRACE;
 
 DROP TABLES t1,t2,t3;
@@ -169,7 +169,7 @@ DROP TABLES t1,t2,t3;
 create table t1 (a int, b int);
 insert into t1 values (1,1), (2,null), (3, 4);
 select max(x) from (select sum(a) as x from t1 group by b) as teeone;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select TRACE from information_schema.OPTIMIZER_TRACE;
 drop table t1;
 
@@ -613,7 +613,7 @@ SELECT SUM(alias2.col_varchar_nokey) , a
 STRAIGHT_JOIN t2 AS alias2 ON alias2.pk = alias1.col_int_key WHERE alias1.pk
 GROUP BY field2 ORDER BY alias1.col_int_key,alias2.pk ;
 eval $query;
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 SELECT * FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
 
 DROP TABLE t1,t2;

=== modified file 'mysql-test/suite/opt_trace/include/subquery.inc'
--- a/mysql-test/suite/opt_trace/include/subquery.inc	2011-11-18 12:17:45 +0000
+++ b/mysql-test/suite/opt_trace/include/subquery.inc	2012-02-14 15:07:11 +0000
@@ -175,7 +175,7 @@ sq4_alias3.`col_varchar_nokey` <> alias1
 alias1.`col_int_key` not in (214) group by field1,field2,field3,
 field4,field5,field6; 
 
---replace_regex /("sort_buffer_size":) [0-9]+/\1 NNN/
+--replace_regex /("sort_buffer_size":) [0-9]+/\1 "NNN"/
 select * from information_schema.optimizer_trace;
 set optimizer_switch=@old_opt_switch;
 drop table t1,t2,t3,t4,t5;

=== modified file 'mysql-test/suite/opt_trace/r/general2_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_no_prot.result	2012-02-13 15:23:37 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_no_prot.result	2012-02-14 15:07:11 +0000
@@ -1164,7 +1164,7 @@ TRACE
               "rows": 4,
               "examined_rows": 4,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }
@@ -1424,7 +1424,7 @@ TRACE
                     "rows": 3,
                     "examined_rows": 3,
                     "number_of_tmp_files": 0,
-                    "sort_buffer_size": NNN,
+                    "sort_buffer_size": "NNN",
                     "sort_mode": "<sort_key, rowid>"
                   } /* filesort_summary */
                 }
@@ -4950,7 +4950,7 @@ GROUP BY field2 ORDER BY alias1.col_int_
               "rows": 8,
               "examined_rows": 8,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general2_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/general2_ps_prot.result	2012-02-13 15:23:37 +0000
+++ b/mysql-test/suite/opt_trace/r/general2_ps_prot.result	2012-02-14 15:07:11 +0000
@@ -1180,7 +1180,7 @@ TRACE
               "rows": 4,
               "examined_rows": 4,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }
@@ -1440,7 +1440,7 @@ TRACE
                     "rows": 3,
                     "examined_rows": 3,
                     "number_of_tmp_files": 0,
-                    "sort_buffer_size": NNN,
+                    "sort_buffer_size": "NNN",
                     "sort_mode": "<sort_key, rowid>"
                   } /* filesort_summary */
                 }
@@ -5001,7 +5001,7 @@ GROUP BY field2 ORDER BY alias1.col_int_
               "rows": 8,
               "examined_rows": 8,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_no_prot_all.result'
--- a/mysql-test/suite/opt_trace/r/general_no_prot_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_no_prot_all.result	2012-02-14 15:07:11 +0000
@@ -6624,7 +6624,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_no_prot_none.result'
--- a/mysql-test/suite/opt_trace/r/general_no_prot_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_no_prot_none.result	2012-02-14 15:07:11 +0000
@@ -5764,7 +5764,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_ps_prot_all.result'
--- a/mysql-test/suite/opt_trace/r/general_ps_prot_all.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_ps_prot_all.result	2012-02-14 15:07:11 +0000
@@ -6590,7 +6590,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/general_ps_prot_none.result'
--- a/mysql-test/suite/opt_trace/r/general_ps_prot_none.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/general_ps_prot_none.result	2012-02-14 15:07:11 +0000
@@ -5722,7 +5722,7 @@ trace
               "rows": 2,
               "examined_rows": 2,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/subquery_no_prot.result'
--- a/mysql-test/suite/opt_trace/r/subquery_no_prot.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/subquery_no_prot.result	2012-02-14 15:07:11 +0000
@@ -1781,7 +1781,7 @@ field4,field5,field6	{
               "rows": 0,
               "examined_rows": 0,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== modified file 'mysql-test/suite/opt_trace/r/subquery_ps_prot.result'
--- a/mysql-test/suite/opt_trace/r/subquery_ps_prot.result	2012-02-08 15:25:17 +0000
+++ b/mysql-test/suite/opt_trace/r/subquery_ps_prot.result	2012-02-14 15:07:11 +0000
@@ -1759,7 +1759,7 @@ field4,field5,field6	{
               "rows": 0,
               "examined_rows": 0,
               "number_of_tmp_files": 0,
-              "sort_buffer_size": NNN,
+              "sort_buffer_size": "NNN",
               "sort_mode": "<sort_key, rowid>"
             } /* filesort_summary */
           }

=== added file 'mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result	2012-02-15 12:05:06 +0000
@@ -0,0 +1,345 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_without'@'santa.claus.ipv4.example.com';
+create user 'user_with'@'santa.claus.ipv4.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv4.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv4.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	1
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv4.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	2
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	3
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	4
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	5
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	6
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+drop user 'user_with'@'santa.claus.ipv4.example.com';
+drop user 'user_without'@'santa.claus.ipv4.example.com';
+set global debug= default;

=== added file 'mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result	2012-02-15 12:05:06 +0000
@@ -0,0 +1,241 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_ssl'@'santa.claus.ipv4.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv4.example.com'
+  REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+  REQUIRE SUBJECT '/C=??/ST=??/L=??/
+    O=No such thing/
+    CN=Santa Claus/emailAddress=santa.claus@stripped';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv4.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	1
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv4.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	2
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv4.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	3
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv4.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	192.0.2.4
+HOST	santa.claus.ipv4.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	4
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+drop user 'user_ssl'@'santa.claus.ipv4.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv4.example.com';
+set global debug= default;

=== added file 'mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result	2012-02-15 12:05:06 +0000
@@ -0,0 +1,345 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_without'@'santa.claus.ipv6.example.com';
+create user 'user_with'@'santa.claus.ipv6.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv6.example.com';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv6.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	1
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv6.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	2
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	3
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	4
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	5
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	6
+COUNT_SSL_ERRORS	0
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+drop user 'user_with'@'santa.claus.ipv6.example.com';
+drop user 'user_without'@'santa.claus.ipv6.example.com';
+set global debug= default;

=== added file 'mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result'
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result	2012-02-15 12:05:06 +0000
@@ -0,0 +1,241 @@
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+@@global.debug
+
+create user 'user_ssl'@'santa.claus.ipv6.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv6.example.com'
+  REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+  REQUIRE SUBJECT '/C=??/ST=??/L=??/
+    O=No such thing/
+    CN=Santa Claus/emailAddress=santa.claus@stripped';
+select "Con1 is alive";
+Con1 is alive
+Con1 is alive
+select current_user();
+current_user()
+root@localhost
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv6.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	1
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv6.example.com' (using password: NO)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	2
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv6.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	3
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv6.example.com' (using password: YES)
+select 
+IP, HOST, HOST_VALIDATED, SUM_CONNECT_ERRORS,
+COUNT_HOST_BLOCKED_ERRORS,
+COUNT_NAMEINFO_TRANSIENT_ERRORS,
+COUNT_NAMEINFO_PERMANENT_ERRORS,
+COUNT_FORMAT_ERRORS,
+COUNT_ADDRINFO_TRANSIENT_ERRORS,
+COUNT_ADDRINFO_PERMANENT_ERRORS,
+COUNT_FCRDNS_ERRORS,
+COUNT_HOST_ACL_ERRORS,
+COUNT_NO_AUTH_PLUGIN_ERRORS,
+COUNT_AUTH_PLUGIN_ERRORS,
+COUNT_HANDSHAKE_ERRORS,
+COUNT_PROXY_USER_ERRORS,
+COUNT_PROXY_USER_ACL_ERRORS,
+COUNT_AUTHENTICATION_ERRORS,
+COUNT_SSL_ERRORS,
+COUNT_MAX_USER_CONNECTION_ERRORS,
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS,
+COUNT_DEFAULT_DATABASE_ERRORS,
+COUNT_INIT_CONNECT_ERRORS,
+COUNT_LOCAL_ERRORS,
+COUNT_UNKNOWN_ERRORS,
+if (FIRST_ERROR_SEEN is not null, "set", "null") as FIRST_ERROR_SEEN,
+if (LAST_ERROR_SEEN is not null, "set", "null") as LAST_ERROR_SEEN
+from performance_schema.host_cache;
+IP	2001:db8::6:6
+HOST	santa.claus.ipv6.example.com
+HOST_VALIDATED	YES
+SUM_CONNECT_ERRORS	0
+COUNT_HOST_BLOCKED_ERRORS	0
+COUNT_NAMEINFO_TRANSIENT_ERRORS	0
+COUNT_NAMEINFO_PERMANENT_ERRORS	0
+COUNT_FORMAT_ERRORS	0
+COUNT_ADDRINFO_TRANSIENT_ERRORS	0
+COUNT_ADDRINFO_PERMANENT_ERRORS	0
+COUNT_FCRDNS_ERRORS	0
+COUNT_HOST_ACL_ERRORS	0
+COUNT_NO_AUTH_PLUGIN_ERRORS	0
+COUNT_AUTH_PLUGIN_ERRORS	0
+COUNT_HANDSHAKE_ERRORS	0
+COUNT_PROXY_USER_ERRORS	0
+COUNT_PROXY_USER_ACL_ERRORS	0
+COUNT_AUTHENTICATION_ERRORS	0
+COUNT_SSL_ERRORS	4
+COUNT_MAX_USER_CONNECTION_ERRORS	0
+COUNT_MAX_USER_CONNECTION_PER_HOUR_ERRORS	0
+COUNT_DEFAULT_DATABASE_ERRORS	0
+COUNT_INIT_CONNECT_ERRORS	0
+COUNT_LOCAL_ERRORS	0
+COUNT_UNKNOWN_ERRORS	0
+FIRST_ERROR_SEEN	set
+LAST_ERROR_SEEN	set
+drop user 'user_ssl'@'santa.claus.ipv6.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv6.example.com';
+set global debug= default;

=== modified file 'mysql-test/suite/perfschema/r/threads_innodb.result'
--- a/mysql-test/suite/perfschema/r/threads_innodb.result	2010-12-06 07:28:45 +0000
+++ b/mysql-test/suite/perfschema/r/threads_innodb.result	2012-02-15 02:19:04 +0000
@@ -11,3 +11,4 @@ thread/innodb/srv_error_monitor_thread	B
 thread/innodb/srv_lock_timeout_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES
 thread/innodb/srv_master_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES
 thread/innodb/srv_monitor_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES
+thread/innodb/srv_purge_thread	BACKGROUND	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	YES

=== added file 'mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_passwd.test	2012-02-15 12:05:06 +0000
@@ -0,0 +1,86 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from user authentication:
+# - reported in COUNT_AUTHENTICATION_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_without'@'santa.claus.ipv4.example.com';
+create user 'user_with'@'santa.claus.ipv4.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv4.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv4.example.com';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"127.0.0.1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"127.0.0.1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"127.0.0.1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"127.0.0.1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2e,"127.0.0.1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2f,"127.0.0.1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_with'@'santa.claus.ipv4.example.com';
+drop user 'user_without'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+

=== added file 'mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv4_ssl.test	2012-02-15 12:05:06 +0000
@@ -0,0 +1,74 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from SSL:
+# - reported in COUNT_SSL_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_ssl'@'santa.claus.ipv4.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv4.example.com'
+  REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv4.example.com'
+  REQUIRE SUBJECT '/C=??/ST=??/L=??/
+    O=No such thing/
+    CN=Santa Claus/emailAddress=santa.claus@stripped';
+
+connect (con1,"127.0.0.1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"127.0.0.1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"127.0.0.1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"127.0.0.1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"127.0.0.1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_ssl'@'santa.claus.ipv4.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv4.example.com';
+
+set global debug= default;
+

=== added file 'mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd-master.opt	2012-02-15 12:05:06 +0000
@@ -0,0 +1 @@
+--bind-addr=::

=== added file 'mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_passwd.test	2012-02-15 12:05:06 +0000
@@ -0,0 +1,86 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from user authentication:
+# - reported in COUNT_AUTHENTICATION_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_without'@'santa.claus.ipv6.example.com';
+create user 'user_with'@'santa.claus.ipv6.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_without'@'santa.claus.ipv6.example.com';
+grant select on test.* to 'user_with'@'santa.claus.ipv6.example.com';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"::1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"::1",user_without,extra_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"::1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"::1",user_with,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2e,"::1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2f,"::1",user_with,wrong_password,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_with'@'santa.claus.ipv6.example.com';
+drop user 'user_without'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+

=== added file 'mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl-master.opt	2012-02-15 12:05:06 +0000
@@ -0,0 +1 @@
+--bind-addr=::

=== added file 'mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test'
--- a/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/hostcache_ipv6_ssl.test	2012-02-15 12:05:06 +0000
@@ -0,0 +1,74 @@
+
+#
+# Tests for the performance_schema host_cache.
+#
+# Simulate failures from SSL:
+# - reported in COUNT_SSL_ERRORS
+
+--source include/not_embedded.inc
+--source include/have_debug.inc
+--source include/have_perfschema.inc
+
+# Enforce a clean state
+--source ../include/wait_for_pfs_thread_count.inc
+
+flush status;
+flush hosts;
+flush user_resources;
+select @@global.debug;
+
+create user 'user_ssl'@'santa.claus.ipv6.example.com';
+create user 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+  identified by 'good_password';
+grant select on test.* to 'user_ssl'@'santa.claus.ipv6.example.com'
+  REQUIRE SSL;
+grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv6.example.com'
+  REQUIRE SUBJECT '/C=??/ST=??/L=??/
+    O=No such thing/
+    CN=Santa Claus/emailAddress=santa.claus@stripped';
+
+connect (con1,"::1",root,,test,$MASTER_MYPORT,);
+select "Con1 is alive";
+select current_user();
+disconnect con1;
+
+--connection default
+set global debug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2a,"::1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2b,"::1",user_ssl,,test,$MASTER_MYPORT,);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2c,"::1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+--disable_query_log
+--error ER_ACCESS_DENIED_ERROR
+connect (con2d,"::1",user_ssl_x509,good_password,test,$MASTER_MYPORT,,SSL);
+--enable_query_log
+
+--connection default
+--source ../include/hostcache_dump.inc
+
+drop user 'user_ssl'@'santa.claus.ipv6.example.com';
+drop user 'user_ssl_x509'@'santa.claus.ipv6.example.com';
+
+set global debug= default;
+

=== added file 'mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_max_purge_lag_delay_basic.result	2012-02-15 04:58:01 +0000
@@ -0,0 +1,43 @@
+SELECT @@GLOBAL.innodb_max_purge_lag_delay;
+@@GLOBAL.innodb_max_purge_lag_delay
+0
+0 Expected
+SET @@GLOBAL.innodb_max_purge_lag_delay=1;
+SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
+COUNT(@@GLOBAL.innodb_max_purge_lag_delay)
+1
+1 Expected
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
+VARIABLE_VALUE
+1
+1 Expected
+SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
+@@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay
+1
+1 Expected
+SELECT COUNT(@@innodb_max_purge_lag_delay);
+COUNT(@@innodb_max_purge_lag_delay)
+1
+1 Expected
+SELECT COUNT(@@local.innodb_max_purge_lag_delay);
+ERROR HY000: Variable 'innodb_max_purge_lag_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
+ERROR HY000: Variable 'innodb_max_purge_lag_delay' is a GLOBAL variable
+Expected error 'Variable is a GLOBAL variable'
+SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;
+ERROR 42S22: Unknown column 'innodb_max_purge_lag_delay' in 'field list'
+set global innodb_max_purge_lag_delay = -1;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_purge_lag_delay value: '-1'
+set global innodb_max_purge_lag_delay = 1000000;
+set global innodb_max_purge_lag_delay = 10000000;
+set global innodb_max_purge_lag_delay = 100000000;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_purge_lag_delay value: '100000000'
+set global innodb_max_purge_lag_delay = 100000001;
+Warnings:
+Warning	1292	Truncated incorrect innodb_max_purge_lag_delay value: '100000001'
+set global innodb_max_purge_lag_delay = 0;

=== modified file 'mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result'
--- a/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result	2010-04-29 17:43:10 +0000
+++ b/mysql-test/suite/sys_vars/r/innodb_purge_threads_basic.result	2012-02-15 01:12:54 +0000
@@ -1,53 +1,41 @@
-'#---------------------BS_STVARS_035_01----------------------#'
 SELECT COUNT(@@GLOBAL.innodb_purge_threads);
 COUNT(@@GLOBAL.innodb_purge_threads)
 1
 1 Expected
-'#---------------------BS_STVARS_035_02----------------------#'
-SET @@GLOBAL.innodb_purge_threads=1;
-ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
-Expected error 'Read only variable'
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
+SELECT COUNT(@@innodb_purge_threads);
+COUNT(@@innodb_purge_threads)
 1
 1 Expected
-'#---------------------BS_STVARS_035_03----------------------#'
+SET @@GLOBAL.innodb_purge_threads=1;
+ERROR HY000: Variable 'innodb_purge_threads' is a read only variable
+Expected error 'Read-only variable'
+SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
+ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
+Expected error 'Read-only variable'
 SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_purge_threads';
 @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 1
 1 Expected
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
-1
-1 Expected
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_purge_threads';
 COUNT(VARIABLE_VALUE)
 1
 1 Expected
-'#---------------------BS_STVARS_035_04----------------------#'
 SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads;
 @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads
 1
 1 Expected
-'#---------------------BS_STVARS_035_05----------------------#'
-SELECT COUNT(@@innodb_purge_threads);
-COUNT(@@innodb_purge_threads)
-1
-1 Expected
 SELECT COUNT(@@local.innodb_purge_threads);
 ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable
 Expected error 'Variable is a GLOBAL variable'
 SELECT COUNT(@@SESSION.innodb_purge_threads);
 ERROR HY000: Variable 'innodb_purge_threads' is a GLOBAL variable
 Expected error 'Variable is a GLOBAL variable'
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
-COUNT(@@GLOBAL.innodb_purge_threads)
-1
-1 Expected
-SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
-ERROR 42S22: Unknown column 'innodb_purge_threads' in 'field list'
-Expected error 'Readonly variable'
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME = 'innodb_purge_threads';
+VARIABLE_NAME	VARIABLE_VALUE
+INNODB_PURGE_THREADS	1

=== added file 'mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_max_purge_lag_delay_basic.test	2012-02-15 04:58:01 +0000
@@ -0,0 +1,43 @@
+# Variable Name: innodb_max_purge_lag_delay
+# Scope: Global                                                               #
+# Access Type: Static                                                         #
+# Data Type: numeric                                                          #
+
+--source include/have_innodb.inc
+
+SELECT @@GLOBAL.innodb_max_purge_lag_delay;
+--echo 0 Expected
+
+SET @@GLOBAL.innodb_max_purge_lag_delay=1;
+
+SELECT COUNT(@@GLOBAL.innodb_max_purge_lag_delay);
+--echo 1 Expected
+
+SELECT VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
+WHERE VARIABLE_NAME='innodb_max_purge_lag_delay';
+--echo 1 Expected
+
+SELECT @@innodb_max_purge_lag_delay = @@GLOBAL.innodb_max_purge_lag_delay;
+--echo 1 Expected
+
+SELECT COUNT(@@innodb_max_purge_lag_delay);
+--echo 1 Expected
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@local.innodb_max_purge_lag_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT COUNT(@@SESSION.innodb_max_purge_lag_delay);
+--echo Expected error 'Variable is a GLOBAL variable'
+
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_max_purge_lag_delay = @@SESSION.innodb_max_purge_lag_delay;
+
+set global innodb_max_purge_lag_delay = -1;
+set global innodb_max_purge_lag_delay = 1000000;
+set global innodb_max_purge_lag_delay = 10000000;
+set global innodb_max_purge_lag_delay = 100000000;
+set global innodb_max_purge_lag_delay = 100000001;
+set global innodb_max_purge_lag_delay = 0;

=== modified file 'mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test'
--- a/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test	2010-04-29 17:43:10 +0000
+++ b/mysql-test/suite/sys_vars/t/innodb_purge_threads_basic.test	2012-02-15 01:12:54 +0000
@@ -1,89 +1,37 @@
-
-
-################## mysql-test\t\innodb_log_purge_threads_basic.test ###########
-#                                                                             #
-# Variable Name: innodb_purge_threads                                         #
-# Scope: Global                                                               #
-# Access Type: Static                                                         #
-# Data Type: numeric                                                          #
-#                                                                             #
-#                                                                             #
-# Creation Date: 2008-02-07                                                   #
-# Author : Sharique Abdullah                                                      #
-#                                                                             #
-#                                                                             #
-# Description:Test Cases of Dynamic System Variable innodb_purge_threads      #
-#             that checks the behavior of this variable in the following ways #
-#              * Value Check                                                  #
-#              * Scope Check                                                  #
-#                                                                             #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/                          #
-#  server-system-variables.html                                               #
-#                                                                             #
-###############################################################################
+# Variable name: innodb_purge_threads
+# Scope: Global
+# Access type: Static
+# Data type: numeric
 
 --source include/have_innodb.inc
 
---echo '#---------------------BS_STVARS_035_01----------------------#'
-####################################################################
-#   Displaying default value                                       #
-####################################################################
 SELECT COUNT(@@GLOBAL.innodb_purge_threads);
 --echo 1 Expected
 
-
---echo '#---------------------BS_STVARS_035_02----------------------#'
-####################################################################
-#   Check if Value can set                                         #
-####################################################################
+SELECT COUNT(@@innodb_purge_threads);
+--echo 1 Expected
 
 --error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SET @@GLOBAL.innodb_purge_threads=1;
---echo Expected error 'Read only variable'
-
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
+--echo Expected error 'Read-only variable'
 
-
-
-
---echo '#---------------------BS_STVARS_035_03----------------------#'
-#################################################################
-# Check if the value in GLOBAL Table matches value in variable  #
-#################################################################
+--Error ER_BAD_FIELD_ERROR
+SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
+--echo Expected error 'Read-only variable'
 
 SELECT @@GLOBAL.innodb_purge_threads = VARIABLE_VALUE
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 WHERE VARIABLE_NAME='innodb_purge_threads';
 --echo 1 Expected
 
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
-
 SELECT COUNT(VARIABLE_VALUE)
 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
 WHERE VARIABLE_NAME='innodb_purge_threads';
 --echo 1 Expected
 
-
-
---echo '#---------------------BS_STVARS_035_04----------------------#'
-################################################################################
-#  Check if accessing variable with and without GLOBAL point to same variable  #
-################################################################################
 SELECT @@innodb_purge_threads = @@GLOBAL.innodb_purge_threads;
 --echo 1 Expected
 
-
-
---echo '#---------------------BS_STVARS_035_05----------------------#'
-################################################################################
-#   Check if innodb_purge_threads can be accessed with and without @@ sign     #
-################################################################################
-
-SELECT COUNT(@@innodb_purge_threads);
---echo 1 Expected
-
 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
 SELECT COUNT(@@local.innodb_purge_threads);
 --echo Expected error 'Variable is a GLOBAL variable'
@@ -92,11 +40,8 @@ SELECT COUNT(@@local.innodb_purge_thread
 SELECT COUNT(@@SESSION.innodb_purge_threads);
 --echo Expected error 'Variable is a GLOBAL variable'
 
-SELECT COUNT(@@GLOBAL.innodb_purge_threads);
---echo 1 Expected
-
---Error ER_BAD_FIELD_ERROR
-SELECT innodb_purge_threads = @@SESSION.innodb_purge_threads;
---echo Expected error 'Readonly variable'
-
+# Check the default value
+SELECT VARIABLE_NAME, VARIABLE_VALUE
+FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
+WHERE VARIABLE_NAME = 'innodb_purge_threads';
 

=== added file 'mysql-test/t/subquery_sj_all-master.opt'
--- a/mysql-test/t/subquery_sj_all-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_all_bka-master.opt'
--- a/mysql-test/t/subquery_sj_all_bka-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all_bka-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt'
--- a/mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all_bka_nixbnl-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_all_bkaunique-master.opt'
--- a/mysql-test/t/subquery_sj_all_bkaunique-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_all_bkaunique-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed_bka-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed_bka-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed_bka-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed_bka_nixbnl-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt'
--- a/mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_dupsweed_bkaunique-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_firstmatch-master.opt'
--- a/mysql-test/t/subquery_sj_firstmatch-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_firstmatch-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== added file 'mysql-test/t/subquery_sj_firstmatch_bka-master.opt'
--- a/mysql-test/t/subquery_sj_firstmatch_bka-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/subquery_sj_firstmatch_bka-master.opt	2012-02-14 17:23:39 +0000
@@ -0,0 +1 @@
+--thread-stack=524288

=== modified file 'sql-common/my_time.c'
--- a/sql-common/my_time.c	2012-01-24 11:57:25 +0000
+++ b/sql-common/my_time.c	2012-02-14 20:35:05 +0000
@@ -909,6 +909,9 @@ void my_init_time(void)
   my_time.hour=		(uint) l_time->tm_hour;
   my_time.minute=	(uint) l_time->tm_min;
   my_time.second=	(uint) l_time->tm_sec;
+  my_time.time_type= MYSQL_TIMESTAMP_DATETIME;
+  my_time.neg= 0;
+  my_time.second_part= 0;
   my_system_gmt_sec(&my_time, &my_time_zone, &not_used); /* Init my_time_zone */
 }
 

=== modified file 'sql/sql_optimizer.cc'
--- a/sql/sql_optimizer.cc	2012-02-09 17:07:12 +0000
+++ b/sql/sql_optimizer.cc	2012-02-14 14:42:12 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -3739,24 +3739,31 @@ bool uses_index_fields_only(Item *item,
 
   const Item::Type item_type= item->type();
 
-  /* 
-    Don't push down the triggered conditions. Nested outer joins execution 
-    code may need to evaluate a condition several times (both triggered and
-    untriggered), and there is no way to put thi
-    TODO: Consider cloning the triggered condition and using the copies for:
-      1. push the first copy down, to have most restrictive index condition
-         possible
-      2. Put the second copy into tab->m_condition. 
-  */
-  if (item_type == Item::FUNC_ITEM && 
-      ((Item_func*)item)->functype() == Item_func::TRIG_COND_FUNC)
-    return FALSE;
-
   switch (item_type) {
   case Item::FUNC_ITEM:
     {
-      /* This is a function, apply condition recursively to arguments */
       Item_func *item_func= (Item_func*)item;
+      const Item_func::Functype func_type= item_func->functype();
+
+      /*
+        Avoid some function types from being pushed down to storage engine:
+        - Don't push down the triggered conditions. Nested outer joins
+          execution code may need to evaluate a condition several times
+          (both triggered and untriggered).
+          TODO: Consider cloning the triggered condition and using the
+                copies for: 
+                 1. push the first copy down, to have most restrictive
+                    index condition possible.
+                 2. Put the second copy into tab->m_condition.
+        - Stored functions contain a statement that might start new operations
+          against the storage engine. This does not work against all storage
+          engines.
+      */
+      if (func_type == Item_func::TRIG_COND_FUNC ||
+          func_type == Item_func::FUNC_SP)
+        return false;
+
+      /* This is a function, apply condition recursively to arguments */
       if (item_func->argument_count() > 0)
       {        
         Item **item_end= (item_func->arguments()) + item_func->argument_count();

=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc	2012-02-13 08:22:20 +0000
+++ b/storage/innobase/handler/ha_innodb.cc	2012-02-15 02:28:36 +0000
@@ -14362,8 +14362,8 @@ static MYSQL_SYSVAR_ULONG(purge_threads,
   PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
   "Purge threads can be from 0 to 32. Default is 0.",
   NULL, NULL,
-  0,			/* Default setting */
-  0,			/* Minimum value */
+  1,			/* Default setting */
+  1,			/* Minimum value */
   32, 0);		/* Maximum value */
 
 static MYSQL_SYSVAR_ULONG(sync_array_size, srv_sync_array_size,
@@ -14476,6 +14476,14 @@ static MYSQL_SYSVAR_ULONG(max_purge_lag,
   "Desired maximum length of the purge queue (0 = no limit)",
   NULL, NULL, 0, 0, ~0UL, 0);
 
+static MYSQL_SYSVAR_ULONG(max_purge_lag_delay, srv_max_purge_lag_delay,
+   PLUGIN_VAR_RQCMDARG,
+   "Maximum delay of user threads in micro-seconds",
+   NULL, NULL, 
+   0L,			/* Default seting */
+   0L,			/* Minimum value */
+   10000000UL, 0);	/* Maximum value */
+ 
 static MYSQL_SYSVAR_BOOL(rollback_on_timeout, innobase_rollback_on_timeout,
   PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_READONLY,
   "Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)",
@@ -14950,6 +14958,7 @@ static struct st_mysql_sys_var* innobase
   MYSQL_SYSVAR(max_dirty_pages_pct),
   MYSQL_SYSVAR(adaptive_flushing),
   MYSQL_SYSVAR(max_purge_lag),
+  MYSQL_SYSVAR(max_purge_lag_delay),
   MYSQL_SYSVAR(mirrored_log_groups),
   MYSQL_SYSVAR(old_blocks_pct),
   MYSQL_SYSVAR(old_blocks_time),

=== modified file 'storage/innobase/include/srv0srv.h'
--- a/storage/innobase/include/srv0srv.h	2012-02-14 05:30:35 +0000
+++ b/storage/innobase/include/srv0srv.h	2012-02-15 01:51:32 +0000
@@ -254,6 +254,7 @@ extern ulong	srv_checksum_algorithm;
 
 extern ulong	srv_max_buf_pool_modified_pct;
 extern ulong	srv_max_purge_lag;
+extern ulong	srv_max_purge_lag_delay;
 
 extern ulong	srv_replication_delay;
 /*-------------------------------------------*/

=== modified file 'storage/innobase/srv/srv0srv.cc'
--- a/storage/innobase/srv/srv0srv.cc	2012-02-14 07:58:25 +0000
+++ b/storage/innobase/srv/srv0srv.cc	2012-02-15 01:12:54 +0000
@@ -265,8 +265,8 @@ that during a time of heavy update/inser
 
 UNIV_INTERN ulong	srv_max_buf_pool_modified_pct	= 75;
 
-/* the number of purge threads to use from the worker pool (currently 0 or 1).*/
-UNIV_INTERN ulong srv_n_purge_threads = 0;
+/* The number of purge threads to use.*/
+UNIV_INTERN ulong srv_n_purge_threads = 1;
 
 /* the number of pages to purge in one batch */
 UNIV_INTERN ulong srv_purge_batch_size = 20;
@@ -1719,7 +1719,6 @@ srv_get_active_thread_type(void)
 
 	/* Check only on shutdown. */
 	if (ret == SRV_NONE
-	    && srv_n_purge_threads > 0
 	    && srv_shutdown_state != SRV_SHUTDOWN_NONE
 	    && trx_purge_state() != PURGE_STATE_EXIT) {
 
@@ -1812,8 +1811,7 @@ srv_wake_purge_thread_if_not_active(void
 {
 	ut_ad(!srv_sys_mutex_own());
 
-	if (srv_n_purge_threads > 0
-	    && purge_sys->state == PURGE_STATE_RUN
+	if (purge_sys->state == PURGE_STATE_RUN
 	    && srv_sys->n_threads_active[SRV_PURGE] == 0) {
 
 		srv_release_threads(SRV_PURGE, 1);
@@ -1879,41 +1877,6 @@ srv_sync_log_buffer_in_background(void)
 }
 
 /********************************************************************//**
-Do a full purge, reconfigure the purge sub-system if a dynamic
-change is detected.
-@return total pages purged */
-static
-ulint
-srv_master_do_purge(void)
-/*=====================*/
-{
-	ulint	n_pages_purged;
-	ulint	total_pages_purged = 0;
-
-	ut_a(srv_n_purge_threads == 0);
-
-	do {
-		srv_main_thread_op_info = "master purging";
-
-		/* Check for shutdown and change in purge config. */
-		if (srv_fast_shutdown
-		    && srv_shutdown_state > SRV_SHUTDOWN_NONE) {
-
-			/* Nothing to purge. */
-			n_pages_purged = 0;
-		} else {
-			n_pages_purged = trx_purge(1, srv_purge_batch_size);
-		}
-
-		total_pages_purged += n_pages_purged;
-		srv_sync_log_buffer_in_background();
-
-	} while (n_pages_purged > 0);
-
-	return(total_pages_purged);
-}
-
-/********************************************************************//**
 Make room in the table cache by evicting an unused table.
 @return number of tables evicted. */
 static
@@ -1949,8 +1912,6 @@ srv_shutdown_print_master_pending(
 						print the message */
 	ulint		n_tables_to_drop,	/*!< number of tables to
 						be dropped */
-	ulint		n_pages_purged,		/*!< number of pages just
-						purged */
 	ulint		n_bytes_merged)		/*!< number of change buffer
 						just merged */
 {
@@ -1970,18 +1931,6 @@ srv_shutdown_print_master_pending(
 				(ulong) n_tables_to_drop);
 		}
 
-		/* Check undo log purge, we only wait for the purge
-		if it is a slow shutdown */
-		if (!srv_fast_shutdown && n_pages_purged) {
-			ut_print_timestamp(stderr);
-			fprintf(stderr, "  InnoDB: Waiting for %lu "
-				"undo logs to be purged\n"
-				"  InnoDB: number of pages just "
-				"purged: %lu\n",
-					(ulong) trx_sys->rseg_history_len,
-					(ulong) n_pages_purged);
-			}
-
 		/* Check change buffer merge, we only wait for change buffer
 		merge if it is a slow shutdown */
 		if (!srv_fast_shutdown && n_bytes_merged) {
@@ -2063,14 +2012,6 @@ srv_master_do_active_tasks(void)
 		return;
 	}
 
-	/* Do a purge if we don't have a dedicated purge thread */
-	if (srv_n_purge_threads == 0
-	    && cur_time % SRV_MASTER_PURGE_INTERVAL == 0) {
-		srv_master_do_purge();
-		MONITOR_INC_TIME_IN_MICRO_SECS(
-			MONITOR_SRV_PURGE_MICROSECOND, counter_time);
-	}
-
 	if (srv_shutdown_state > 0) {
 		return;
 	}
@@ -2155,13 +2096,6 @@ srv_master_do_idle_tasks(void)
 	MONITOR_INC_TIME_IN_MICRO_SECS(
 		MONITOR_SRV_LOG_FLUSH_MICROSECOND, counter_time);
 
-	/* Do a purge if we don't have a dedicated purge thread */
-	if (srv_n_purge_threads == 0) {
-		srv_master_do_purge();
-		MONITOR_INC_TIME_IN_MICRO_SECS(
-			MONITOR_SRV_PURGE_MICROSECOND, counter_time);
-	}
-
 	if (srv_shutdown_state > 0) {
 		return;
 	}
@@ -2188,7 +2122,6 @@ srv_master_do_shutdown_tasks(
 	ib_time_t*	last_print_time)/*!< last time the function
 					print the message */
 {
-	ulint		n_pages_purged = 0;
 	ulint		n_bytes_merged = 0;
 	ulint		n_tables_to_drop = 0;
 
@@ -2224,11 +2157,6 @@ srv_master_do_shutdown_tasks(
 	/* Flush logs if needed */
 	srv_sync_log_buffer_in_background();
 
-	/* Do a purge if we don't have a dedicated purge thread */
-	if (srv_n_purge_threads == 0) {
-		n_pages_purged = srv_master_do_purge();
-	}
-
 func_exit:
 	/* Make a new checkpoint about once in 10 seconds */
 	srv_main_thread_op_info = "making checkpoint";
@@ -2236,15 +2164,11 @@ func_exit:
 
 	/* Print progress message every 60 seconds during shutdown */
 	if (srv_shutdown_state > 0 && srv_print_verbose_log) {
-		srv_shutdown_print_master_pending(last_print_time,
-						  n_tables_to_drop,
-						  n_pages_purged,
-						  n_bytes_merged);
+		srv_shutdown_print_master_pending(
+			last_print_time, n_tables_to_drop, n_bytes_merged);
 	}
 
-	return(n_pages_purged
-	       || n_bytes_merged
-               || n_tables_to_drop);
+	return(n_bytes_merged || n_tables_to_drop);
 }
 
 /*********************************************************************//**
@@ -2276,15 +2200,6 @@ DECLARE_THREAD(srv_master_thread)(
 	ulint		old_activity_count = srv_get_activity_count();
 	ib_time_t	last_print_time;
 
-	if (srv_n_purge_threads == 0) {
-		/* Note that we are shutting down. */
-		rw_lock_x_lock(&purge_sys->latch);
-
-		purge_sys->state = PURGE_STATE_RUN;
-
-		rw_lock_x_unlock(&purge_sys->latch);
-	}
-
 #ifdef UNIV_DEBUG_THREAD_CREATION
 	fprintf(stderr, "Master thread starts, id %lu\n",
 		os_thread_pf(os_thread_get_curr_id()));
@@ -2340,16 +2255,6 @@ suspend_thread:
 	os_event_wait(slot->event);
 
 	if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) {
-		if (srv_n_purge_threads == 0) {
-			/* Note that we are shutting down. */
-			rw_lock_x_lock(&purge_sys->latch);
-
-			purge_sys->state = PURGE_STATE_EXIT;
-
-			purge_sys->running = false;
-
-			rw_lock_x_unlock(&purge_sys->latch);
-		}
 		os_thread_exit(NULL);
 	}
 
@@ -2801,8 +2706,7 @@ void
 srv_purge_wakeup(void)
 /*==================*/
 {
-	if (srv_n_purge_threads > 0
-	    && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
+	if (srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
 
 		srv_release_threads(SRV_PURGE, 1);
 

=== modified file 'storage/innobase/srv/srv0start.cc'
--- a/storage/innobase/srv/srv0start.cc	2012-02-14 07:32:57 +0000
+++ b/storage/innobase/srv/srv0start.cc	2012-02-15 01:12:54 +0000
@@ -2217,10 +2217,7 @@ innobase_start_or_create_for_mysql(void)
 		srv_master_thread,
 		NULL, thread_ids + (1 + SRV_MAX_N_IO_THREADS));
 
-	/* If the user has requested a separate purge thread then
-	start the purge thread. */
-	if (srv_n_purge_threads >= 1
-	    && srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
+	if (srv_force_recovery < SRV_FORCE_NO_BACKGROUND) {
 
 		os_thread_create(
 			srv_purge_coordinator_thread,
@@ -2229,6 +2226,7 @@ innobase_start_or_create_for_mysql(void)
 		ut_a(UT_ARR_SIZE(thread_ids)
 		     > 5 + srv_n_purge_threads + SRV_MAX_N_IO_THREADS);
 
+		/* We've already created the purge coordinator thread above. */
 		for (i = 1; i < srv_n_purge_threads; ++i) {
 			os_thread_create(
 				srv_worker_thread, NULL,

=== modified file 'storage/innobase/trx/trx0purge.cc'
--- a/storage/innobase/trx/trx0purge.cc	2012-02-14 05:30:35 +0000
+++ b/storage/innobase/trx/trx0purge.cc	2012-02-15 01:51:32 +0000
@@ -49,6 +49,9 @@ Created 3/26/1996 Heikki Tuuri
 /** Maximum allowable purge history length.  <=0 means 'infinite'. */
 UNIV_INTERN ulong		srv_max_purge_lag = 0;
 
+/** Max DML user threads delay in micro-seconds. */
+UNIV_INTERN ulong		srv_max_purge_lag_delay = 0;
+
 /** The global data structure coordinating a purge */
 UNIV_INTERN trx_purge_t*	purge_sys = NULL;
 
@@ -140,10 +143,7 @@ trx_purge_sys_create(
 
 	purge_sys->heap = mem_heap_create(256);
 
-	/* Handle the case for the traditional mode. */
-	if (n_purge_threads == 0) {
-		n_purge_threads = 1;
-	}
+	ut_a(n_purge_threads > 0);
 
 	purge_sys->sess = sess_open();
 
@@ -1092,27 +1092,28 @@ trx_purge_dml_delay(void)
 	thread. */
 	ulint	delay = 0; /* in microseconds; default: no delay */
 
-	/* If we cannot advance the 'purge view' because of an old
-	'consistent read view', then the DML statements cannot be delayed.
-	Also, srv_max_purge_lag <= 0 means 'infinity'. Note: we do a dirty
-	read of the trx_sys_t data structure here, without holding
-	trx_sys->mutex. */
-	if (srv_max_purge_lag > 0
-	    && !UT_LIST_GET_LAST(trx_sys->view_list)) {
-		float	ratio = (float) trx_sys->rseg_history_len
-			/ srv_max_purge_lag;
-		if (ratio > ULINT_MAX / 10000) {
-			/* Avoid overflow: maximum delay is 4295 seconds */
-			delay = ULINT_MAX;
-		} else if (ratio > 1) {
+	/* If purge lag is set (ie. > 0) then calculate the new DML delay.
+	Note: we do a dirty read of the trx_sys_t data structure here,
+	without holding trx_sys->mutex. */
+
+	if (srv_max_purge_lag > 0) {
+		float	ratio;
+
+		ratio = float(trx_sys->rseg_history_len) / srv_max_purge_lag;
+
+		if (ratio > 1.0) {
 			/* If the history list length exceeds the
-			innodb_max_purge_lag, the
-			data manipulation statements are delayed
-			by at least 5000 microseconds. */
+			srv_max_purge_lag, the data manipulation
+			statements are delayed by at least 5000
+			microseconds. */
 			delay = (ulint) ((ratio - .5) * 10000);
 		}
 
-		MONITOR_SET(MONITOR_DML_PURGE_DELAY, srv_dml_needed_delay);
+		if (delay > srv_max_purge_lag_delay) {
+			delay = srv_max_purge_lag_delay;
+		}
+
+		MONITOR_SET(MONITOR_DML_PURGE_DELAY, delay);
 	}
 
 	return(delay);

=== modified file 'vio/vio.c'
--- a/vio/vio.c	2011-08-18 05:29:13 +0000
+++ b/vio/vio.c	2012-02-15 07:20:32 +0000
@@ -217,8 +217,6 @@ Vio *mysql_socket_vio_new(MYSQL_SOCKET m
   if ((vio = (Vio*) my_malloc(sizeof(*vio),MYF(MY_WME))))
   {
     vio_init(vio, type, sd, flags);
-    sprintf(vio->desc,
-	    (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"), sd);
     vio->mysql_socket= mysql_socket;
   }
   DBUG_RETURN(vio);

=== modified file 'vio/viosocket.c'
--- a/vio/viosocket.c	2011-08-29 12:08:58 +0000
+++ b/vio/viosocket.c	2012-02-15 07:20:32 +0000
@@ -430,6 +430,12 @@ int vio_close(Vio * vio)
 
 const char *vio_description(Vio * vio)
 {
+  if (!vio->desc[0])
+  {
+    my_snprintf(vio->desc, VIO_DESCRIPTION_SIZE,
+                (vio->type == VIO_TYPE_SOCKET ? "socket (%d)" : "TCP/IP (%d)"),
+                mysql_socket_getfd(vio->mysql_socket));
+  }
   return vio->desc;
 }
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl5259 branch (marc.alff:3380 to 3382) Marc Alff15 Feb