List:Commits« Previous MessageNext Message »
From:Marc Alff Date:July 15 2011 8:28am
Subject:bzr push into mysql-trunk branch (marc.alff:3262 to 3263)
View as plain text  
 3263 Marc Alff	2011-07-15 [merge]
      Merge mysql-trunk-wl5342 --> mysql-trunk-stage

    modified:
      include/mysql/psi/psi.h
      include/mysql/psi/psi_abi_v1.h.pp
      mysql-test/suite/perfschema/r/dml_setup_objects.result
      mysql-test/suite/perfschema/r/information_schema.result
      mysql-test/suite/perfschema/r/pfs_upgrade.result
      mysql-test/suite/perfschema/r/privilege_table_io.result
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/setup_objects.result
      mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_off.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
      mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
      mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
      mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
      mysql-test/suite/perfschema/r/table_schema.result
      mysql-test/suite/perfschema/t/dml_setup_objects.test
      mysql-test/suite/perfschema/t/privilege_table_io.test
      mysql-test/suite/perfschema/t/setup_objects.test
      mysys/psi_noop.cc
      scripts/mysql_system_tables.sql
      sql/ha_partition.cc
      sql/ha_partition.h
      sql/handler.cc
      sql/handler.h
      sql/rpl_slave.cc
      sql/sql_base.cc
      storage/perfschema/pfs.cc
      storage/perfschema/pfs_defaults.cc
      storage/perfschema/pfs_instr.cc
      storage/perfschema/pfs_instr.h
      storage/perfschema/pfs_setup_object.cc
      storage/perfschema/table_setup_objects.cc
      storage/perfschema/table_setup_objects.h
 3262 Gleb Shchepa	2011-07-14
      BUG #11754979 - 46675: ON DUPLICATE KEY UPDATE AND UPDATECOUNT() POSSIBLY WRONG
      
      The mysql_affected_rows() client call returns 3 instead of 2 on
      INSERT ... ON DUPLICATE KEY UPDATE query with a duplicated key value.
      
      The fix for the old bug #29692 was incomplete: unnecessary double
      increment of "touched" rows still happened.
      
      This bugfix removes:
      1) unneeded increment of "touched" rows and
      2) useless double resetting of auto-increment value.
     @ sql/sql_insert.cc
        write_record() function:
        Unneeded increment of "touched" rows and useless double resetting
        of auto-increment value has been removed.
     @ tests/mysql_client_test.c
        New test case.

    modified:
      sql/sql_insert.cc
      tests/mysql_client_test.c
=== modified file 'include/mysql/psi/psi.h'
--- a/include/mysql/psi/psi.h	2011-07-01 08:46:20 +0000
+++ b/include/mysql/psi/psi.h	2011-07-05 16:45:26 +0000
@@ -950,6 +950,23 @@ typedef struct PSI_table* (*open_table_v
   (struct PSI_table_share *share, const void *identity);
 
 /**
+  Unbind a table handle from the current thread.
+  This operation happens when an opened table is added to the open table cache.
+  @param table the table to unbind
+*/
+typedef void (*unbind_table_v1_t)
+  (struct PSI_table *table);
+
+/**
+  Rebind a table handle to the current thread.
+  This operation happens when a table from the open table cache
+  is reused for a thread.
+  @param table the table to unbind
+*/
+typedef void (*rebind_table_v1_t)
+  (struct PSI_table *table);
+
+/**
   Close an instrumentation table handle.
   Note that the table handle is invalid after this call.
   @param table the table handle to close
@@ -1573,6 +1590,10 @@ struct PSI_v1
   drop_table_share_v1_t drop_table_share;
   /** @sa open_table_v1_t. */
   open_table_v1_t open_table;
+  /** @sa unbind_table_v1_t. */
+  unbind_table_v1_t unbind_table;
+  /** @sa rebind_table_v1_t. */
+  rebind_table_v1_t rebind_table;
   /** @sa close_table_v1_t. */
   close_table_v1_t close_table;
   /** @sa create_file_v1_t. */

=== modified file 'include/mysql/psi/psi_abi_v1.h.pp'
--- a/include/mysql/psi/psi_abi_v1.h.pp	2011-07-01 08:46:20 +0000
+++ b/include/mysql/psi/psi_abi_v1.h.pp	2011-07-05 16:45:26 +0000
@@ -227,6 +227,10 @@ typedef void (*drop_table_share_v1_t)
    const char *table_name, int table_name_length);
 typedef struct PSI_table* (*open_table_v1_t)
   (struct PSI_table_share *share, const void *identity);
+typedef void (*unbind_table_v1_t)
+  (struct PSI_table *table);
+typedef void (*rebind_table_v1_t)
+  (struct PSI_table *table);
 typedef void (*close_table_v1_t)(struct PSI_table *table);
 typedef void (*create_file_v1_t)(PSI_file_key key, const char *name,
                                  File file);
@@ -387,6 +391,8 @@ struct PSI_v1
   release_table_share_v1_t release_table_share;
   drop_table_share_v1_t drop_table_share;
   open_table_v1_t open_table;
+  unbind_table_v1_t unbind_table;
+  rebind_table_v1_t rebind_table;
   close_table_v1_t close_table;
   create_file_v1_t create_file;
   spawn_thread_v1_t spawn_thread;

=== modified file 'mysql-test/suite/perfschema/r/dml_setup_objects.result'
--- a/mysql-test/suite/perfschema/r/dml_setup_objects.result	2010-11-15 15:04:34 +0000
+++ b/mysql-test/suite/perfschema/r/dml_setup_objects.result	2011-07-14 09:53:42 +0000
@@ -3,40 +3,40 @@ create table test.setup_objects as
 select * from performance_schema.setup_objects;
 truncate table performance_schema.setup_objects;
 select * from performance_schema.setup_objects;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
 select * from performance_schema.setup_objects
 where object_type = 'TABLE'
   order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
 insert into performance_schema.setup_objects
 set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
-timed='YES';
+enabled='YES', timed='YES';
 ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
 insert into performance_schema.setup_objects
 set object_type='TABLE', object_schema='FOO', object_name='BAR',
-timed='YES';
+enabled='YES', timed='YES';
 insert into performance_schema.setup_objects
 set object_type='TABLE', object_schema='FOO', object_name='BAR',
-timed='NO';
+enabled='YES', timed='NO';
 ERROR 23000: Can't write; duplicate key in table 'setup_objects'
 delete from performance_schema.setup_objects
 where object_type='TABLE' and object_schema='FOO';
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
 insert into performance_schema.setup_objects
 set object_type='TABLE', object_schema='FOO', object_name='BAR',
-timed='YES';
+enabled='NO', timed='YES';
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	FOO	BAR	YES
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	FOO	BAR	NO	YES
 update performance_schema.setup_objects
 set object_type='ILLEGAL';
 ERROR HY000: Invalid performance_schema usage.
@@ -47,13 +47,13 @@ update performance_schema.setup_objects
 set object_name='ILLEGAL';
 ERROR HY000: Invalid performance_schema usage.
 update performance_schema.setup_objects
-set timed='NO';
+set enabled='NO', timed='NO';
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	FOO	BAR	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	FOO	BAR	NO	NO
 update performance_schema.setup_objects
-set timed='YES';
+set enabled='YES', timed='YES';
 delete from performance_schema.setup_objects
 where object_type = 'TABLE';
 delete from performance_schema.setup_objects;

=== modified file 'mysql-test/suite/perfschema/r/information_schema.result'
--- a/mysql-test/suite/perfschema/r/information_schema.result	2011-02-14 14:23:55 +0000
+++ b/mysql-test/suite/perfschema/r/information_schema.result	2011-05-05 06:11:49 +0000
@@ -140,7 +140,7 @@ rwlock_instances	1000	0
 setup_actors	1	0
 setup_consumers	11	0
 setup_instruments	1000	0
-setup_objects	3	0
+setup_objects	4	0
 setup_timers	3	0
 table_io_waits_summary_by_index_usage	1000	0
 table_io_waits_summary_by_table	1000	0

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-06-15 08:02:11 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-06-27 14:15:12 +0000
@@ -25,23 +25,23 @@ ERROR 1050 (42S01) at line 281: Table 'r
 ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
 ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
 ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 513: Table 'threads' already exists
-ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 318: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 326: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 371: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 415: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 494: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 514: Table 'threads' already exists
+ERROR 1050 (42S01) at line 529: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 544: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 559: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 572: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 584: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 627: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 670: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 713: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 745: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 776: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1196: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -71,23 +71,23 @@ ERROR 1050 (42S01) at line 281: Table 'r
 ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
 ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
 ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 513: Table 'threads' already exists
-ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 318: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 326: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 371: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 415: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 494: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 514: Table 'threads' already exists
+ERROR 1050 (42S01) at line 529: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 544: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 559: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 572: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 584: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 627: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 670: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 713: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 745: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 776: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1196: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -115,23 +115,23 @@ ERROR 1050 (42S01) at line 281: Table 'r
 ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
 ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
 ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 513: Table 'threads' already exists
-ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 318: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 326: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 371: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 415: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 494: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 514: Table 'threads' already exists
+ERROR 1050 (42S01) at line 529: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 544: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 559: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 572: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 584: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 627: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 670: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 713: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 745: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 776: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1196: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -159,23 +159,23 @@ ERROR 1050 (42S01) at line 281: Table 'r
 ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
 ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
 ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 513: Table 'threads' already exists
-ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 318: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 326: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 371: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 415: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 494: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 514: Table 'threads' already exists
+ERROR 1050 (42S01) at line 529: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 544: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 559: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 572: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 584: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 627: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 670: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 713: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 745: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 776: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1196: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -203,23 +203,23 @@ ERROR 1050 (42S01) at line 281: Table 'r
 ERROR 1050 (42S01) at line 290: Table 'setup_actors' already exists
 ERROR 1050 (42S01) at line 298: Table 'setup_consumers' already exists
 ERROR 1050 (42S01) at line 307: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 317: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 325: Table 'setup_timers' already exists
-ERROR 1050 (42S01) at line 370: Table 'table_io_waits_summary_by_index_usage' already exists
-ERROR 1050 (42S01) at line 414: Table 'table_io_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 493: Table 'table_lock_waits_summary_by_table' already exists
-ERROR 1050 (42S01) at line 513: Table 'threads' already exists
-ERROR 1050 (42S01) at line 528: Table 'events_stages_current' already exists
-ERROR 1050 (42S01) at line 543: Table 'events_stages_history' already exists
-ERROR 1050 (42S01) at line 558: Table 'events_stages_history_long' already exists
-ERROR 1050 (42S01) at line 571: Table 'events_stages_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 583: Table 'events_stages_summary_global_by_event_name' already exists
-ERROR 1050 (42S01) at line 626: Table 'events_statements_current' already exists
-ERROR 1050 (42S01) at line 669: Table 'events_statements_history' already exists
-ERROR 1050 (42S01) at line 712: Table 'events_statements_history_long' already exists
-ERROR 1050 (42S01) at line 744: Table 'events_statements_summary_by_thread_by_event_name' already exists
-ERROR 1050 (42S01) at line 775: Table 'events_statements_summary_global_by_event_name' already exists
-ERROR 1644 (HY000) at line 1195: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 318: Table 'setup_objects' already exists
+ERROR 1050 (42S01) at line 326: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 371: Table 'table_io_waits_summary_by_index_usage' already exists
+ERROR 1050 (42S01) at line 415: Table 'table_io_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 494: Table 'table_lock_waits_summary_by_table' already exists
+ERROR 1050 (42S01) at line 514: Table 'threads' already exists
+ERROR 1050 (42S01) at line 529: Table 'events_stages_current' already exists
+ERROR 1050 (42S01) at line 544: Table 'events_stages_history' already exists
+ERROR 1050 (42S01) at line 559: Table 'events_stages_history_long' already exists
+ERROR 1050 (42S01) at line 572: Table 'events_stages_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 584: Table 'events_stages_summary_global_by_event_name' already exists
+ERROR 1050 (42S01) at line 627: Table 'events_statements_current' already exists
+ERROR 1050 (42S01) at line 670: Table 'events_statements_history' already exists
+ERROR 1050 (42S01) at line 713: Table 'events_statements_history_long' already exists
+ERROR 1050 (42S01) at line 745: Table 'events_statements_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 776: Table 'events_statements_summary_global_by_event_name' already exists
+ERROR 1644 (HY000) at line 1196: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/privilege_table_io.result'
--- a/mysql-test/suite/perfschema/r/privilege_table_io.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/privilege_table_io.result	2011-05-05 06:11:49 +0000
@@ -9,6 +9,8 @@ flush status;
 # We are forced to suppress here the server response.
 optimize table mysql.db;
 update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_objects set enabled='YES'
+  where object_type='TABLE' and object_schema= 'mysql';
 flush privileges;
 insert into test.marker set a = 1;
 insert into test.marker set a = 1;
@@ -113,3 +115,5 @@ drop table test.marker;
 flush status;
 update performance_schema.setup_instruments set enabled='YES';
 update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_objects set enabled='NO'
+  where object_type='TABLE' and object_schema= 'mysql';

=== modified file 'mysql-test/suite/perfschema/r/schema.result'
--- a/mysql-test/suite/perfschema/r/schema.result	2011-06-13 17:04:25 +0000
+++ b/mysql-test/suite/perfschema/r/schema.result	2011-06-27 14:15:12 +0000
@@ -473,6 +473,7 @@ setup_objects	CREATE TABLE `setup_object
   `OBJECT_TYPE` enum('TABLE') NOT NULL DEFAULT 'TABLE',
   `OBJECT_SCHEMA` varchar(64) DEFAULT '%',
   `OBJECT_NAME` varchar(64) NOT NULL DEFAULT '%',
+  `ENABLED` enum('YES','NO') NOT NULL DEFAULT 'YES',
   `TIMED` enum('YES','NO') NOT NULL DEFAULT 'YES'
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
 show create table setup_timers;

=== modified file 'mysql-test/suite/perfschema/r/setup_objects.result'
--- a/mysql-test/suite/perfschema/r/setup_objects.result	2010-11-15 15:04:34 +0000
+++ b/mysql-test/suite/perfschema/r/setup_objects.result	2011-07-14 09:53:42 +0000
@@ -2,29 +2,91 @@ drop table if exists test.setup_objects;
 create table test.setup_objects as select * from performance_schema.setup_objects;
 truncate table performance_schema.setup_objects;
 insert into performance_schema.setup_objects
-values ('TABLE', 'db1', 't1', 'YES');
+values ('TABLE', 'db1', 't1', 'YES', 'YES');
 insert into performance_schema.setup_objects
-values ('TABLE', 'db1', 't2', 'NO');
+values ('TABLE', 'db1', 't2', 'YES', 'NO');
 insert into performance_schema.setup_objects
-values ('TABLE', 'db1', '%', 'YES');
+values ('TABLE', 'db1', '%', 'YES', 'YES');
 insert into performance_schema.setup_objects
-values ('TABLE', 'db2', 't1', 'YES');
+values ('TABLE', 'db2', 't1', 'YES', 'YES');
 insert into performance_schema.setup_objects
-values ('TABLE', 'db2', 't2', 'NO');
+values ('TABLE', 'db2', 't2', 'YES', 'NO');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db3', 't1', 'YES', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db3', 't2', 'NO', 'NO');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db3', '%', 'NO', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db4', 't1', 'NO', 'YES');
+insert into performance_schema.setup_objects
+values ('TABLE', 'db4', '%', 'YES', 'NO');
+insert into performance_schema.setup_objects
+values ('SOMETHING', 'bad1', 'bad1', 'YES', 'NO');
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+show warnings;
+Level	Code	Message
+Warning	1265	Data truncated for column 'OBJECT_TYPE' at row 1
+Error	1452	Cannot add or update a child row: a foreign key constraint fails ()
+insert into performance_schema.setup_objects
+values ('TABLE', 'bad2', 'bad2', 'MAYBE', 'NO');
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+show warnings;
+Level	Code	Message
+Warning	1265	Data truncated for column 'ENABLED' at row 1
+Error	1452	Cannot add or update a child row: a foreign key constraint fails ()
+insert into performance_schema.setup_objects
+values ('TABLE', 'bad3', 'bad3', 'YES', 'MAYBE NOT');
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+show warnings;
+Level	Code	Message
+Warning	1265	Data truncated for column 'TIMED' at row 1
+Error	1452	Cannot add or update a child row: a foreign key constraint fails ()
 select * from performance_schema.setup_objects
 order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	db1	%	YES
-TABLE	db1	t1	YES
-TABLE	db1	t2	NO
-TABLE	db2	t1	YES
-TABLE	db2	t2	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	db1	%	YES	YES
+TABLE	db1	t1	YES	YES
+TABLE	db1	t2	YES	NO
+TABLE	db2	t1	YES	YES
+TABLE	db2	t2	YES	NO
+TABLE	db3	%	NO	YES
+TABLE	db3	t1	YES	YES
+TABLE	db3	t2	NO	NO
+TABLE	db4	%	YES	NO
+TABLE	db4	t1	NO	YES
+update performance_schema.setup_objects
+set OBJECT_TYPE='SOMETHING' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.setup_objects
+set ENABLED='MAYBE' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+update performance_schema.setup_objects
+set TIMED='MAYBE NOT' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+ERROR 23000: Cannot add or update a child row: a foreign key constraint fails ()
+select * from performance_schema.setup_objects
+order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	db1	%	YES	YES
+TABLE	db1	t1	YES	YES
+TABLE	db1	t2	YES	NO
+TABLE	db2	t1	YES	YES
+TABLE	db2	t2	YES	NO
+TABLE	db3	%	NO	YES
+TABLE	db3	t1	YES	YES
+TABLE	db3	t2	NO	NO
+TABLE	db4	%	YES	NO
+TABLE	db4	t1	NO	YES
 drop database if exists db1;
 drop database if exists db2;
 drop database if exists db3;
+drop database if exists db4;
+drop database if exists db5;
 create database db1;
 create database db2;
 create database db3;
+create database db4;
+create database db5;
 create table db1.t1(a int);
 create table db1.t2(a int);
 create table db1.t3(a int);
@@ -36,6 +98,16 @@ create table db2.t3(a int);
 create table db2.t4(a int);
 create table db2.t5(a int);
 create table db3.t1(a int);
+create table db3.t2(a int);
+create table db3.t3(a int);
+create table db3.t4(a int);
+create table db3.t5(a int);
+create table db4.t1(a int);
+create table db4.t2(a int);
+create table db4.t3(a int);
+create table db4.t4(a int);
+create table db4.t5(a int);
+create table db5.t1(a int);
 select * from db1.t1;
 a
 select * from db1.t2;
@@ -58,7 +130,27 @@ select * from db2.t5;
 a
 select * from db3.t1;
 a
-create table db3.t2(a int);
+select * from db3.t2;
+a
+select * from db3.t3;
+a
+select * from db3.t4;
+a
+select * from db3.t5;
+a
+select * from db4.t1;
+a
+select * from db4.t2;
+a
+select * from db4.t3;
+a
+select * from db4.t4;
+a
+select * from db4.t5;
+a
+select * from db5.t1;
+a
+create table db5.t2(a int);
 select * from db3.t2;
 a
 select distinct OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA 
@@ -69,11 +161,16 @@ order by OBJECT_TYPE, OBJECT_NAME, OBJEC
 OBJECT_TYPE	OBJECT_NAME	OBJECT_SCHEMA
 TABLE	t1	db1
 TABLE	t1	db2
+TABLE	t1	db3
 TABLE	t2	db1
 TABLE	t2	db2
+TABLE	t2	db4
 TABLE	t3	db1
+TABLE	t3	db4
 TABLE	t4	db1
+TABLE	t4	db4
 TABLE	t5	db1
+TABLE	t5	db4
 select distinct OBJECT_TYPE, OBJECT_NAME, OBJECT_SCHEMA 
 from performance_schema.events_waits_history_long
 where OBJECT_SCHEMA like "db%" and TIMER_END is not NULL
@@ -82,12 +179,13 @@ order by OBJECT_TYPE, OBJECT_NAME, OBJEC
 OBJECT_TYPE	OBJECT_NAME	OBJECT_SCHEMA
 TABLE	t1	db1
 TABLE	t1	db2
+TABLE	t1	db3
 TABLE	t3	db1
 TABLE	t4	db1
 TABLE	t5	db1
 update performance_schema.setup_objects
 set timed='YES' where OBJECT_SCHEMA = '%';
-create table db3.t3(a int);
+create table db5.t3(a int);
 select * from db3.t3;
 a
 truncate table performance_schema.setup_objects;
@@ -97,6 +195,8 @@ count(*)
 drop database db1;
 drop database db2;
 drop database db3;
+drop database db4;
+drop database db5;
 truncate table performance_schema.setup_objects;
 insert into performance_schema.setup_objects select * from test.setup_objects;
 drop table test.setup_objects;

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result	2011-05-05 06:11:49 +0000
@@ -11,9 +11,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result	2011-05-05 06:11:49 +0000
@@ -9,10 +9,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result	2011-05-05 06:11:49 +0000
@@ -11,9 +11,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result	2011-05-05 06:11:49 +0000
@@ -9,10 +9,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result	2011-05-18 16:02:19 +0000
@@ -9,9 +9,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -191,8 +191,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	25
@@ -236,8 +236,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -321,8 +321,8 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -368,8 +368,8 @@ TABLE	test	t3	31
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -462,12 +462,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	77
@@ -511,12 +511,12 @@ TABLE	test	t3	82
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -614,12 +614,12 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -669,12 +669,12 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -721,12 +721,12 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
-wait/lock/table/sql/handler	56
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -774,12 +774,12 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
-wait/lock/table/sql/handler	56
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -827,8 +827,8 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -874,8 +874,8 @@ TABLE	test	t3	86
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result	2011-05-18 16:02:19 +0000
@@ -7,10 +7,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -190,8 +190,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	37
@@ -237,8 +237,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -324,8 +324,8 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -373,8 +373,8 @@ TABLE	test	t3	31
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -469,12 +469,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	113
@@ -520,12 +520,12 @@ TABLE	test	t3	82
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -625,12 +625,12 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -682,12 +682,12 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -736,12 +736,12 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
-wait/lock/table/sql/handler	84
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -791,12 +791,12 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
-wait/lock/table/sql/handler	84
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -846,8 +846,8 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -895,8 +895,8 @@ TABLE	test	t3	86
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result	2011-05-18 16:02:19 +0000
@@ -9,9 +9,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -191,8 +191,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	25
@@ -236,8 +236,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -321,10 +321,10 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	64
@@ -368,10 +368,10 @@ TABLE	test	t3	72
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -462,12 +462,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	116
@@ -511,12 +511,12 @@ TABLE	test	t3	123
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -614,14 +614,14 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -669,14 +669,14 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -721,14 +721,14 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
-wait/lock/table/sql/handler	104
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -774,14 +774,14 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
-wait/lock/table/sql/handler	104
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -825,12 +825,12 @@ TABLE	test	t3	188
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -874,10 +874,10 @@ TABLE	test	t3	188
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -921,8 +921,8 @@ TABLE	test	t3	188
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result	2011-05-18 16:02:19 +0000
@@ -7,10 +7,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -190,8 +190,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	37
@@ -237,8 +237,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -324,10 +324,10 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	94
@@ -373,10 +373,10 @@ TABLE	test	t3	72
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -469,12 +469,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	170
@@ -520,12 +520,12 @@ TABLE	test	t3	123
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -625,14 +625,14 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -682,14 +682,14 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -736,14 +736,14 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
-wait/lock/table/sql/handler	156
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -791,14 +791,14 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
-wait/lock/table/sql/handler	156
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -844,12 +844,12 @@ TABLE	test	t3	188
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -895,10 +895,10 @@ TABLE	test	t3	188
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -944,8 +944,8 @@ TABLE	test	t3	188
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_off.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_off.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result	2011-05-05 06:11:49 +0000
@@ -9,10 +9,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result	2011-05-18 16:02:19 +0000
@@ -11,9 +11,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -193,8 +193,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	25
@@ -234,8 +234,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -315,8 +315,8 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -358,8 +358,8 @@ TABLE	test	t3	31
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -448,12 +448,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	77
@@ -493,12 +493,12 @@ TABLE	test	t3	82
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -592,12 +592,12 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -643,12 +643,12 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -691,12 +691,12 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
-wait/lock/table/sql/handler	56
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -740,12 +740,12 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
-wait/lock/table/sql/handler	56
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -789,8 +789,8 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -832,8 +832,8 @@ TABLE	test	t3	86
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result	2011-05-18 16:02:19 +0000
@@ -9,10 +9,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -192,8 +192,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	37
@@ -233,8 +233,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -314,8 +314,8 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -357,8 +357,8 @@ TABLE	test	t3	31
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -447,12 +447,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	113
@@ -492,12 +492,12 @@ TABLE	test	t3	82
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -591,12 +591,12 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -642,12 +642,12 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -690,12 +690,12 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
-wait/lock/table/sql/handler	84
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -739,12 +739,12 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
-wait/lock/table/sql/handler	84
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -788,8 +788,8 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -831,8 +831,8 @@ TABLE	test	t3	86
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result	2011-05-18 16:02:19 +0000
@@ -11,9 +11,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -193,8 +193,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	25
@@ -234,8 +234,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -315,10 +315,10 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	64
@@ -358,10 +358,10 @@ TABLE	test	t3	72
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -448,12 +448,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	116
@@ -493,12 +493,12 @@ TABLE	test	t3	123
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -592,14 +592,14 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -643,14 +643,14 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -691,14 +691,14 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
-wait/lock/table/sql/handler	104
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -740,14 +740,14 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
-wait/lock/table/sql/handler	104
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	25
+wait/lock/table/sql/handler	32
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -787,12 +787,12 @@ TABLE	test	t3	188
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	39
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -832,10 +832,10 @@ TABLE	test	t3	188
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	52
+wait/lock/table/sql/handler	24
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181
@@ -875,8 +875,8 @@ TABLE	test	t3	188
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	65
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	181

=== modified file 'mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result	2011-05-18 16:02:19 +0000
@@ -9,10 +9,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -192,8 +192,8 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	37
@@ -233,8 +233,8 @@ TABLE	test	t3	31
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -314,10 +314,10 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	94
@@ -357,10 +357,10 @@ TABLE	test	t3	72
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -447,12 +447,12 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	170
@@ -492,12 +492,12 @@ TABLE	test	t3	123
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -591,14 +591,14 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -642,14 +642,14 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -690,14 +690,14 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
-wait/lock/table/sql/handler	156
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -739,14 +739,14 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
-wait/lock/table/sql/handler	156
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	37
+wait/lock/table/sql/handler	48
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -786,12 +786,12 @@ TABLE	test	t3	188
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	57
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -831,10 +831,10 @@ TABLE	test	t3	188
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	76
+wait/lock/table/sql/handler	36
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265
@@ -874,8 +874,8 @@ TABLE	test	t3	188
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/io/table/sql/handler	95
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	265

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result	2011-05-05 06:11:49 +0000
@@ -13,9 +13,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result	2011-05-05 06:11:49 +0000
@@ -11,10 +11,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result	2011-05-05 06:11:49 +0000
@@ -13,9 +13,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result	2011-05-05 06:11:49 +0000
@@ -11,10 +11,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result	2011-05-18 16:02:19 +0000
@@ -11,9 +11,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -193,7 +193,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -236,7 +236,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -319,7 +319,7 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -364,7 +364,7 @@ TABLE	test	t3	17
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -456,11 +456,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -503,11 +503,11 @@ TABLE	test	t3	54
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -604,11 +604,11 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -657,11 +657,11 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -707,11 +707,11 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -758,11 +758,11 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -809,7 +809,7 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -854,7 +854,7 @@ TABLE	test	t3	54
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result	2011-05-18 16:02:19 +0000
@@ -9,10 +9,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -192,7 +192,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -236,7 +236,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -320,7 +320,7 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -366,7 +366,7 @@ TABLE	test	t3	17
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -459,11 +459,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -507,11 +507,11 @@ TABLE	test	t3	54
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -609,11 +609,11 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -663,11 +663,11 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -714,11 +714,11 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -766,11 +766,11 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -818,7 +818,7 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -864,7 +864,7 @@ TABLE	test	t3	54
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result	2011-05-18 16:02:19 +0000
@@ -11,9 +11,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -193,7 +193,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -236,7 +236,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -319,9 +319,9 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -364,9 +364,9 @@ TABLE	test	t3	44
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -456,11 +456,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -503,11 +503,11 @@ TABLE	test	t3	81
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -604,13 +604,13 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -657,13 +657,13 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -707,13 +707,13 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -758,13 +758,13 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -807,11 +807,11 @@ TABLE	test	t3	128
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -854,9 +854,9 @@ TABLE	test	t3	128
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -899,7 +899,7 @@ TABLE	test	t3	128
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result	2011-05-18 16:02:19 +0000
@@ -9,10 +9,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -192,7 +192,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -236,7 +236,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -320,9 +320,9 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -366,9 +366,9 @@ TABLE	test	t3	44
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -459,11 +459,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -507,11 +507,11 @@ TABLE	test	t3	81
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -609,13 +609,13 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -663,13 +663,13 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -714,13 +714,13 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -766,13 +766,13 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -816,11 +816,11 @@ TABLE	test	t3	128
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -864,9 +864,9 @@ TABLE	test	t3	128
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -910,7 +910,7 @@ TABLE	test	t3	128
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result	2011-05-18 16:02:19 +0000
@@ -13,9 +13,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -195,7 +195,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -236,7 +236,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -317,7 +317,7 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -360,7 +360,7 @@ TABLE	test	t3	17
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -450,11 +450,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -495,11 +495,11 @@ TABLE	test	t3	54
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -594,11 +594,11 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -645,11 +645,11 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -693,11 +693,11 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -742,11 +742,11 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	77
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -791,7 +791,7 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -834,7 +834,7 @@ TABLE	test	t3	54
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result	2011-05-18 16:02:19 +0000
@@ -11,10 +11,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -194,7 +194,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -235,7 +235,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -316,7 +316,7 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -359,7 +359,7 @@ TABLE	test	t3	17
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -449,11 +449,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -494,11 +494,11 @@ TABLE	test	t3	54
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -593,11 +593,11 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -644,11 +644,11 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -692,11 +692,11 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -741,11 +741,11 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	113
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -790,7 +790,7 @@ execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -833,7 +833,7 @@ TABLE	test	t3	54
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result	2011-05-18 16:02:19 +0000
@@ -13,9 +13,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -195,7 +195,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -236,7 +236,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -317,9 +317,9 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -360,9 +360,9 @@ TABLE	test	t3	44
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -450,11 +450,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -495,11 +495,11 @@ TABLE	test	t3	81
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -594,13 +594,13 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -645,13 +645,13 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -693,13 +693,13 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -742,13 +742,13 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	181
+wait/io/table/sql/handler	25
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -789,11 +789,11 @@ TABLE	test	t3	128
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	39
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -834,9 +834,9 @@ TABLE	test	t3	128
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	52
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -877,7 +877,7 @@ TABLE	test	t3	128
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	65
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star

=== modified file 'mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result	2011-04-18 23:41:45 +0000
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result	2011-05-18 16:02:19 +0000
@@ -11,10 +11,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -194,7 +194,7 @@ a	b	c	d
 "================== Step 3 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -235,7 +235,7 @@ TABLE	test	t3	17
 "================== Step 4 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -316,9 +316,9 @@ a	b	c	d
 "================== Step 5 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -359,9 +359,9 @@ TABLE	test	t3	44
 "================== Step 6 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -449,11 +449,11 @@ a	b	c	d
 "================== Step 7 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -494,11 +494,11 @@ TABLE	test	t3	81
 "================== Step 8 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
@@ -593,13 +593,13 @@ a	b	c	d
 "================== Step 9 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -644,13 +644,13 @@ unlock tables;
 "================== Step 10 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -692,13 +692,13 @@ flush tables;
 "================== Step 11 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -741,13 +741,13 @@ set global read_only=0;
 "================== Step 12 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	265
+wait/io/table/sql/handler	37
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -788,11 +788,11 @@ TABLE	test	t3	128
 "================== Step 13 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	57
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -833,9 +833,9 @@ TABLE	test	t3	128
 "================== Step 14 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	76
 wait/lock/table/sql/handler	0
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star
@@ -876,7 +876,7 @@ TABLE	test	t3	128
 "================== Step 15 =================="
 execute dump_thread;
 event_name	count_star
-wait/io/table/sql/handler	0
+wait/io/table/sql/handler	95
 wait/lock/table/sql/handler	0
 execute dump_global;
 event_name	count_star

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result	2011-05-05 06:11:49 +0000
@@ -13,9 +13,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result	2011-05-05 06:11:49 +0000
@@ -11,10 +11,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result	2011-05-05 06:11:49 +0000
@@ -13,9 +13,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result	2011-05-05 06:11:49 +0000
@@ -11,10 +11,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result	2011-05-18 16:02:19 +0000
@@ -11,9 +11,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -194,7 +194,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -237,7 +237,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -320,7 +320,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -365,7 +365,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -457,11 +457,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -504,11 +504,11 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -605,11 +605,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -658,11 +658,11 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -708,11 +708,11 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	56
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -759,11 +759,11 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	56
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -810,7 +810,7 @@ event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -855,7 +855,7 @@ TABLE	test	t3	32
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result	2011-05-18 16:02:19 +0000
@@ -9,10 +9,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -193,7 +193,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -237,7 +237,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -321,7 +321,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -367,7 +367,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -460,11 +460,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -508,11 +508,11 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -610,11 +610,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -664,11 +664,11 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -715,11 +715,11 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	84
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -767,11 +767,11 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	84
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -819,7 +819,7 @@ event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -865,7 +865,7 @@ TABLE	test	t3	32
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result	2011-05-18 16:02:19 +0000
@@ -11,9 +11,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -194,7 +194,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -237,7 +237,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -320,9 +320,9 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -365,9 +365,9 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -457,11 +457,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -504,11 +504,11 @@ TABLE	test	t3	42
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -605,13 +605,13 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -658,13 +658,13 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -708,13 +708,13 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	104
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -759,13 +759,13 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	104
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -808,11 +808,11 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -855,9 +855,9 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -900,7 +900,7 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result	2011-05-18 16:02:19 +0000
@@ -9,10 +9,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	YES
@@ -193,7 +193,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -237,7 +237,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -321,9 +321,9 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -367,9 +367,9 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -460,11 +460,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -508,11 +508,11 @@ TABLE	test	t3	42
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -610,13 +610,13 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -664,13 +664,13 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -715,13 +715,13 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	156
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -767,13 +767,13 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	156
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -817,11 +817,11 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -865,9 +865,9 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -911,7 +911,7 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result	2011-05-18 16:02:19 +0000
@@ -13,9 +13,9 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -196,7 +196,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -237,7 +237,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -318,7 +318,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -361,7 +361,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -451,11 +451,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -496,11 +496,11 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -595,11 +595,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -646,11 +646,11 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -694,11 +694,11 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	56
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -743,11 +743,11 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	56
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -792,7 +792,7 @@ event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -835,7 +835,7 @@ TABLE	test	t3	32
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result	2011-05-18 16:02:19 +0000
@@ -11,10 +11,10 @@ localhost	user1	%
 localhost	user3	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -195,7 +195,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -236,7 +236,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -317,7 +317,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -360,7 +360,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
@@ -450,11 +450,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -495,11 +495,11 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -594,11 +594,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -645,11 +645,11 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -693,11 +693,11 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	84
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -742,11 +742,11 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	84
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -791,7 +791,7 @@ event_name	count_star
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -834,7 +834,7 @@ TABLE	test	t3	32
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result	2011-05-18 16:02:19 +0000
@@ -13,9 +13,9 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -196,7 +196,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -237,7 +237,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -318,9 +318,9 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -361,9 +361,9 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -451,11 +451,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -496,11 +496,11 @@ TABLE	test	t3	42
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -595,13 +595,13 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -646,13 +646,13 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -694,13 +694,13 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	104
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -743,13 +743,13 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	104
+wait/lock/table/sql/handler	32
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -790,11 +790,11 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -835,9 +835,9 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -878,7 +878,7 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	24
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result'
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result	2011-03-23 11:49:30 +0000
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result	2011-05-18 16:02:19 +0000
@@ -11,10 +11,10 @@ localhost	user3	%
 localhost	user4	%
 select * from performance_schema.setup_objects
 order by object_type, object_schema, object_name;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	TIMED
-TABLE	test	t1	YES
-TABLE	test	t2	NO
-TABLE	test	t3	NO
+OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED
+TABLE	test	t1	YES	YES
+TABLE	test	t2	YES	NO
+TABLE	test	t3	YES	NO
 select * from performance_schema.setup_consumers;
 NAME	ENABLED
 events_stages_current	NO
@@ -195,7 +195,7 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -236,7 +236,7 @@ TABLE	test	t3	14
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -317,9 +317,9 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -360,9 +360,9 @@ TABLE	test	t3	28
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -450,11 +450,11 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -495,11 +495,11 @@ TABLE	test	t3	42
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
 wait/lock/table/sql/handler	0
 execute dump_global;
@@ -594,13 +594,13 @@ a	b	c	d
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -645,13 +645,13 @@ unlock tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -693,13 +693,13 @@ flush tables;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	156
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -742,13 +742,13 @@ set global read_only=0;
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	156
+wait/lock/table/sql/handler	48
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -789,11 +789,11 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -834,9 +834,9 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0
@@ -877,7 +877,7 @@ TABLE	test	t3	60
 execute dump_thread;
 event_name	count_star
 wait/io/table/sql/handler	0
-wait/lock/table/sql/handler	0
+wait/lock/table/sql/handler	36
 execute dump_global;
 event_name	count_star
 wait/io/table/sql/handler	0

=== modified file 'mysql-test/suite/perfschema/r/table_schema.result'
--- a/mysql-test/suite/perfschema/r/table_schema.result	2011-06-13 16:28:34 +0000
+++ b/mysql-test/suite/perfschema/r/table_schema.result	2011-06-27 14:15:12 +0000
@@ -323,7 +323,8 @@ def	performance_schema	setup_instruments
 def	performance_schema	setup_objects	OBJECT_TYPE	1	TABLE	NO	enum	5	15	NULL	NULL	utf8	utf8_general_ci	enum('TABLE')			select,insert,update,references	
 def	performance_schema	setup_objects	OBJECT_SCHEMA	2	%	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
 def	performance_schema	setup_objects	OBJECT_NAME	3	%	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
-def	performance_schema	setup_objects	TIMED	4	YES	NO	enum	3	9	NULL	NULL	utf8	utf8_general_ci	enum('YES','NO')			select,insert,update,references	
+def	performance_schema	setup_objects	ENABLED	4	YES	NO	enum	3	9	NULL	NULL	utf8	utf8_general_ci	enum('YES','NO')			select,insert,update,references	
+def	performance_schema	setup_objects	TIMED	5	YES	NO	enum	3	9	NULL	NULL	utf8	utf8_general_ci	enum('YES','NO')			select,insert,update,references	
 def	performance_schema	setup_timers	NAME	1	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	
 def	performance_schema	setup_timers	TIMER_NAME	2	NULL	NO	enum	11	33	NULL	NULL	utf8	utf8_general_ci	enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK')			select,insert,update,references	
 def	performance_schema	table_io_waits_summary_by_index_usage	OBJECT_TYPE	1	NULL	YES	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)			select,insert,update,references	

=== modified file 'mysql-test/suite/perfschema/t/dml_setup_objects.test'
--- a/mysql-test/suite/perfschema/t/dml_setup_objects.test	2010-11-15 15:04:34 +0000
+++ b/mysql-test/suite/perfschema/t/dml_setup_objects.test	2011-07-14 09:53:42 +0000
@@ -44,16 +44,16 @@ select * from performance_schema.setup_o
 --error ER_NO_REFERENCED_ROW_2
 insert into performance_schema.setup_objects
   set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
-  timed='YES';
+  enabled='YES', timed='YES';
 
 insert into performance_schema.setup_objects
   set object_type='TABLE', object_schema='FOO', object_name='BAR',
-  timed='YES';
+  enabled='YES', timed='YES';
 
 --error ER_DUP_KEY
 insert into performance_schema.setup_objects
   set object_type='TABLE', object_schema='FOO', object_name='BAR',
-  timed='NO';
+  enabled='YES', timed='NO';
 
 delete from performance_schema.setup_objects
   where object_type='TABLE' and object_schema='FOO';
@@ -63,7 +63,7 @@ select * from performance_schema.setup_o
 
 insert into performance_schema.setup_objects
   set object_type='TABLE', object_schema='FOO', object_name='BAR',
-  timed='YES';
+  enabled='NO', timed='YES';
 
 select * from performance_schema.setup_objects
   order by object_type, object_schema, object_name;
@@ -81,13 +81,13 @@ update performance_schema.setup_objects
   set object_name='ILLEGAL';
 
 update performance_schema.setup_objects
-  set timed='NO';
+  set enabled='NO', timed='NO';
 
 select * from performance_schema.setup_objects
   order by object_type, object_schema, object_name;
 
 update performance_schema.setup_objects
-  set timed='YES';
+  set enabled='YES', timed='YES';
 
 delete from performance_schema.setup_objects
   where object_type = 'TABLE';

=== modified file 'mysql-test/suite/perfschema/t/privilege_table_io.test'
--- a/mysql-test/suite/perfschema/t/privilege_table_io.test	2010-11-09 08:16:50 +0000
+++ b/mysql-test/suite/perfschema/t/privilege_table_io.test	2011-05-05 06:11:49 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -34,6 +34,8 @@ optimize table mysql.db;
 
 # Start recording events
 update performance_schema.setup_consumers set enabled='YES';
+update performance_schema.setup_objects set enabled='YES'
+  where object_type='TABLE' and object_schema= 'mysql';
 
 # Code to test
 
@@ -52,3 +54,5 @@ let $schema_to_dump= "test", "mysql";
 # Cleanup
 --source ../include/table_io_cleanup_helper.inc
 
+update performance_schema.setup_objects set enabled='NO'
+  where object_type='TABLE' and object_schema= 'mysql';

=== modified file 'mysql-test/suite/perfschema/t/setup_objects.test'
--- a/mysql-test/suite/perfschema/t/setup_objects.test	2010-11-15 15:04:34 +0000
+++ b/mysql-test/suite/perfschema/t/setup_objects.test	2011-07-14 09:53:42 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -25,19 +25,73 @@ create table test.setup_objects as selec
 truncate table performance_schema.setup_objects;
 
 insert into performance_schema.setup_objects
-  values ('TABLE', 'db1', 't1', 'YES');
+  values ('TABLE', 'db1', 't1', 'YES', 'YES');
 
 insert into performance_schema.setup_objects
-  values ('TABLE', 'db1', 't2', 'NO');
+  values ('TABLE', 'db1', 't2', 'YES', 'NO');
 
 insert into performance_schema.setup_objects
-  values ('TABLE', 'db1', '%', 'YES');
+  values ('TABLE', 'db1', '%', 'YES', 'YES');
 
 insert into performance_schema.setup_objects
-  values ('TABLE', 'db2', 't1', 'YES');
+  values ('TABLE', 'db2', 't1', 'YES', 'YES');
 
 insert into performance_schema.setup_objects
-  values ('TABLE', 'db2', 't2', 'NO');
+  values ('TABLE', 'db2', 't2', 'YES', 'NO');
+
+insert into performance_schema.setup_objects
+  values ('TABLE', 'db3', 't1', 'YES', 'YES');
+
+insert into performance_schema.setup_objects
+  values ('TABLE', 'db3', 't2', 'NO', 'NO');
+
+insert into performance_schema.setup_objects
+  values ('TABLE', 'db3', '%', 'NO', 'YES');
+
+insert into performance_schema.setup_objects
+  values ('TABLE', 'db4', 't1', 'NO', 'YES');
+
+insert into performance_schema.setup_objects
+  values ('TABLE', 'db4', '%', 'YES', 'NO');
+
+# Also test insert of invalid enum values
+
+--error ER_NO_REFERENCED_ROW_2
+insert into performance_schema.setup_objects
+  values ('SOMETHING', 'bad1', 'bad1', 'YES', 'NO');
+show warnings;
+
+--error ER_NO_REFERENCED_ROW_2
+insert into performance_schema.setup_objects
+  values ('TABLE', 'bad2', 'bad2', 'MAYBE', 'NO');
+show warnings;
+
+--error ER_NO_REFERENCED_ROW_2
+insert into performance_schema.setup_objects
+  values ('TABLE', 'bad3', 'bad3', 'YES', 'MAYBE NOT');
+show warnings;
+
+select * from performance_schema.setup_objects
+  order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
+
+# Also test update of invalid enum values
+# Note: do not use SHOW WARNINGS in the test,
+# because error messages such as:
+#   "Data truncated for column 'OBJECT_TYPE' at row <N>"
+# do not always use the same row number <N>.
+
+# ER_WRONG_PERFSCHEMA_USAGE because of privileges, expected.
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.setup_objects
+  set OBJECT_TYPE='SOMETHING' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+
+--error ER_NO_REFERENCED_ROW_2
+update performance_schema.setup_objects
+  set ENABLED='MAYBE' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
+
+--error ER_NO_REFERENCED_ROW_2
+update performance_schema.setup_objects
+  set TIMED='MAYBE NOT' where OBJECT_SCHEMA='db1' and OBJECT_NAME='t1';
 
 select * from performance_schema.setup_objects
   order by OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME;
@@ -46,11 +100,15 @@ select * from performance_schema.setup_o
 drop database if exists db1;
 drop database if exists db2;
 drop database if exists db3;
+drop database if exists db4;
+drop database if exists db5;
 --enable_warnings
 
 create database db1;
 create database db2;
 create database db3;
+create database db4;
+create database db5;
 
 create table db1.t1(a int);
 create table db1.t2(a int);
@@ -65,6 +123,18 @@ create table db2.t4(a int);
 create table db2.t5(a int);
 
 create table db3.t1(a int);
+create table db3.t2(a int);
+create table db3.t3(a int);
+create table db3.t4(a int);
+create table db3.t5(a int);
+
+create table db4.t1(a int);
+create table db4.t2(a int);
+create table db4.t3(a int);
+create table db4.t4(a int);
+create table db4.t5(a int);
+
+create table db5.t1(a int);
 
 select * from db1.t1;
 select * from db1.t2;
@@ -79,8 +149,20 @@ select * from db2.t4;
 select * from db2.t5;
 
 select * from db3.t1;
+select * from db3.t2;
+select * from db3.t3;
+select * from db3.t4;
+select * from db3.t5;
 
-create table db3.t2(a int);
+select * from db4.t1;
+select * from db4.t2;
+select * from db4.t3;
+select * from db4.t4;
+select * from db4.t5;
+
+select * from db5.t1;
+
+create table db5.t2(a int);
 select * from db3.t2;
 
 # Verify what is instrumented
@@ -100,7 +182,7 @@ select distinct OBJECT_TYPE, OBJECT_NAME
 update performance_schema.setup_objects
   set timed='YES' where OBJECT_SCHEMA = '%';
 
-create table db3.t3(a int);
+create table db5.t3(a int);
 select * from db3.t3;
 
 truncate table performance_schema.setup_objects;
@@ -110,6 +192,8 @@ select count(*) from performance_schema.
 drop database db1;
 drop database db2;
 drop database db3;
+drop database db4;
+drop database db5;
 
 # Restore the setup
 truncate table performance_schema.setup_objects;

=== modified file 'mysys/psi_noop.cc'
--- a/mysys/psi_noop.cc	2011-07-12 12:10:20 +0000
+++ b/mysys/psi_noop.cc	2011-07-14 08:11:07 +0000
@@ -133,6 +133,16 @@ open_table_noop(PSI_table_share *share, 
   return NULL;
 }
 
+static void unbind_table_noop(PSI_table *table)
+{
+  return;
+}
+
+static void rebind_table_noop(PSI_table *table)
+{
+  return;
+}
+
 static void close_table_noop(PSI_table *table)
 {
   return;
@@ -552,6 +562,8 @@ static PSI PSI_noop=
   release_table_share_noop,
   drop_table_share_noop,
   open_table_noop,
+  unbind_table_noop,
+  rebind_table_noop,
   close_table_noop,
   create_file_noop,
   spawn_thread_noop,

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2011-07-03 23:56:47 +0000
+++ b/scripts/mysql_system_tables.sql	2011-07-05 16:45:26 +0000
@@ -526,6 +526,7 @@ SET @cmd="CREATE TABLE performance_schem
   "OBJECT_TYPE ENUM ('TABLE') not null default 'TABLE',"
   "OBJECT_SCHEMA VARCHAR(64) default '%',"
   "OBJECT_NAME VARCHAR(64) not null default '%',"
+  "ENABLED ENUM ('YES', 'NO') not null default 'YES',"
   "TIMED ENUM ('YES', 'NO') not null default 'YES'"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2011-07-07 09:45:10 +0000
+++ b/sql/ha_partition.cc	2011-07-07 19:13:19 +0000
@@ -2969,6 +2969,33 @@ err_alloc:
   DBUG_RETURN(error);
 }
 
+void ha_partition::unbind_psi()
+{
+  uint i;
+
+  DBUG_ENTER("ha_partition::unbind_psi");
+  handler::unbind_psi();
+  for (i= 0; i < m_tot_parts; i++)
+  {
+    DBUG_ASSERT(m_file[i] != NULL);
+    m_file[i]->unbind_psi();
+  }
+  DBUG_VOID_RETURN;
+}
+
+void ha_partition::rebind_psi()
+{
+  uint i;
+
+  DBUG_ENTER("ha_partition::rebind_psi");
+  handler::rebind_psi();
+  for (i= 0; i < m_tot_parts; i++)
+  {
+    DBUG_ASSERT(m_file[i] != NULL);
+    m_file[i]->rebind_psi();
+  }
+  DBUG_VOID_RETURN;
+}
 
 /**
   Clone the open and locked partitioning handler.

=== modified file 'sql/ha_partition.h'
--- a/sql/ha_partition.h	2011-07-04 00:25:46 +0000
+++ b/sql/ha_partition.h	2011-07-05 16:45:26 +0000
@@ -300,6 +300,8 @@ public:
     If the object was opened it will also be closed before being deleted.
   */
   virtual int open(const char *name, int mode, uint test_if_locked);
+  virtual void unbind_psi();
+  virtual void rebind_psi();
   virtual int close(void);
 
   /*

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2011-07-07 14:26:36 +0000
+++ b/sql/handler.cc	2011-07-14 08:11:07 +0000
@@ -2166,6 +2166,30 @@ THD *handler::ha_thd(void) const
   return (table && table->in_use) ? table->in_use : current_thd;
 }
 
+void handler::unbind_psi()
+{
+#ifdef HAVE_PSI_INTERFACE
+  /*
+    Notify the instrumentation that this table is not owned
+    by this thread any more.
+  */
+  if (likely(PSI_server != NULL))
+    PSI_server->unbind_table(m_psi);
+#endif
+}
+
+void handler::rebind_psi()
+{
+#ifdef HAVE_PSI_INTERFACE
+  /*
+    Notify the instrumentation that this table is now owned
+    by this thread.
+  */
+  if (likely(PSI_server != NULL))
+    PSI_server->rebind_table(m_psi);
+#endif
+}
+
 PSI_table_share *handler::ha_table_share_psi(const TABLE_SHARE *share) const
 {
   return share->m_psi;

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2011-07-04 00:25:46 +0000
+++ b/sql/handler.h	2011-07-05 16:45:26 +0000
@@ -1382,6 +1382,9 @@ public:
   */
   PSI_table *m_psi;
 
+  virtual void unbind_psi();
+  virtual void rebind_psi();
+
 private:
   friend class DsMrr_impl;
   /**

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-07-04 00:25:46 +0000
+++ b/sql/rpl_slave.cc	2011-07-05 16:45:26 +0000
@@ -606,7 +606,19 @@ static void set_thd_in_use_temporary_tab
   TABLE *table;
 
   for (table= rli->save_temporary_tables ; table ; table= table->next)
+  {
     table->in_use= rli->info_thd;
+    if (table->file != NULL)
+    {
+      /*
+        Since we are stealing opened temporary tables from one thread to another,
+        we need to let the performance schema know that,
+        for aggregates per thread to work properly.
+      */
+      table->file->unbind_psi();
+      table->file->rebind_psi();
+    }
+  }
 }
 
 int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock)

=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc	2011-07-07 11:51:59 +0000
+++ b/sql/sql_base.cc	2011-07-07 19:13:19 +0000
@@ -466,6 +466,8 @@ static void table_def_use_table(THD *thd
   DBUG_ASSERT(table->db_stat && table->file);
   /* The children must be detached from the table. */
   DBUG_ASSERT(! table->file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN));
+
+  table->file->rebind_psi();
 }
 
 
@@ -476,11 +478,14 @@ static void table_def_use_table(THD *thd
 static void table_def_unuse_table(TABLE *table)
 {
   DBUG_ASSERT(table->in_use);
+  DBUG_ASSERT(table->file);
 
   /* We shouldn't put the table to 'unused' list if the share is old. */
   DBUG_ASSERT(! table->s->has_old_version());
 
   table->in_use= 0;
+  table->file->unbind_psi();
+
   /* Remove table from the list of tables used in this share. */
   table->s->used_tables.remove(table);
   /* Add table to the list of unused TABLE objects for this share. */

=== modified file 'storage/perfschema/pfs.cc'
--- a/storage/perfschema/pfs.cc	2011-07-07 17:57:35 +0000
+++ b/storage/perfschema/pfs.cc	2011-07-07 19:13:19 +0000
@@ -1469,16 +1469,41 @@ open_table_v1(PSI_table_share *share, co
   if (unlikely(thread == NULL))
     return NULL;
 
-  /* Do not instrument this table is all table instruments are disabled. */
-  if (! pfs_table_share->m_enabled)
-    return NULL;
-
   PFS_table *pfs_table= create_table(pfs_table_share, thread, identity);
   return reinterpret_cast<PSI_table *> (pfs_table);
 }
 
 /**
   Implementation of the table instrumentation interface.
+  @sa PSI_v1::unbind_table.
+*/
+static void unbind_table_v1(PSI_table *table)
+{
+  PFS_table *pfs= reinterpret_cast<PFS_table*> (table);
+  if (likely(pfs != NULL))
+  {
+    pfs->aggregate();
+    pfs->m_thread_owner= NULL;
+  }
+}
+
+/**
+  Implementation of the table instrumentation interface.
+  @sa PSI_v1::rebind_table.
+*/
+static void rebind_table_v1(PSI_table *table)
+{
+  PFS_table *pfs= reinterpret_cast<PFS_table*> (table);
+  if (likely(pfs != NULL))
+  {
+    DBUG_ASSERT(pfs->m_thread_owner == NULL);
+
+    pfs->m_thread_owner= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
+  }
+}
+
+/**
+  Implementation of the table instrumentation interface.
   @sa PSI_v1::close_table.
 */
 static void close_table_v1(PSI_table *table)
@@ -2233,13 +2258,17 @@ get_thread_table_io_locker_v1(PSI_table_
   if (! pfs_table->m_io_enabled)
     return NULL;
 
+  PFS_thread *pfs_thread= pfs_table->m_thread_owner;
+  if (unlikely(pfs_thread == NULL))
+    return NULL;
+
+  DBUG_ASSERT(pfs_thread ==
+              my_pthread_getspecific_ptr(PFS_thread*, THR_PFS));
+
   register uint flags;
 
   if (flag_thread_instrumentation)
   {
-    PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
-    if (unlikely(pfs_thread == NULL))
-      return NULL;
     if (! pfs_thread->m_enabled)
       return NULL;
     state->m_thread= reinterpret_cast<PSI_thread *> (pfs_thread);
@@ -2308,6 +2337,7 @@ get_thread_table_lock_locker_v1(PSI_tabl
 {
   DBUG_ASSERT(state != NULL);
   DBUG_ASSERT((op == PSI_TABLE_LOCK) || (op == PSI_TABLE_EXTERNAL_LOCK));
+
   PFS_table *pfs_table= reinterpret_cast<PFS_table*> (table);
 
   if (unlikely(pfs_table == NULL))
@@ -2318,6 +2348,13 @@ get_thread_table_lock_locker_v1(PSI_tabl
   if (! pfs_table->m_lock_enabled)
     return NULL;
 
+  PFS_thread *pfs_thread= pfs_table->m_thread_owner;
+  if (unlikely(pfs_thread == NULL))
+    return NULL;
+
+  DBUG_ASSERT(pfs_thread ==
+              my_pthread_getspecific_ptr(PFS_thread*, THR_PFS));
+
   PFS_TL_LOCK_TYPE lock_type;
 
   switch (op)
@@ -2345,9 +2382,6 @@ get_thread_table_lock_locker_v1(PSI_tabl
 
   if (flag_thread_instrumentation)
   {
-    PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS);
-    if (unlikely(pfs_thread == NULL))
-      return NULL;
     if (! pfs_thread->m_enabled)
       return NULL;
     state->m_thread= reinterpret_cast<PSI_thread *> (pfs_thread);
@@ -4226,6 +4260,8 @@ PSI_v1 PFS_v1=
   release_table_share_v1,
   drop_table_share_v1,
   open_table_v1,
+  unbind_table_v1,
+  rebind_table_v1,
   close_table_v1,
   create_file_v1,
   spawn_thread_v1,

=== modified file 'storage/perfschema/pfs_defaults.cc'
--- a/storage/perfschema/pfs_defaults.cc	2010-09-23 16:08:54 +0000
+++ b/storage/perfschema/pfs_defaults.cc	2011-05-05 06:11:49 +0000
@@ -45,22 +45,18 @@ void install_default_setup(PSI_bootstrap
   /* Enable all users on all hosts by default */
   insert_setup_actor(&percent, &percent, &percent);
 
-#if 0
   /* Disable system tables by default */
   String mysql_db("mysql", 5, &my_charset_utf8_bin);
   insert_setup_object(OBJECT_TYPE_TABLE, &mysql_db, &percent, false, false);
-#endif
+
   /* Disable performance/information schema tables. */
   String PS_db("performance_schema", 18, &my_charset_utf8_bin);
   String IS_db("information_schema", 18, &my_charset_utf8_bin);
   insert_setup_object(OBJECT_TYPE_TABLE, &PS_db, &percent, false, false);
   insert_setup_object(OBJECT_TYPE_TABLE, &IS_db, &percent, false, false);
+
   /* Enable every other tables */
   insert_setup_object(OBJECT_TYPE_TABLE, &percent, &percent, true, true);
-#if 0
-  /* Disable every temporary tables */
-  insert_setup_object(OBJECT_TYPE_TEMPORARY_TABLE, &percent, &percent, false, false);
-#endif
 
   psi->delete_current_thread();
 }

=== modified file 'storage/perfschema/pfs_instr.cc'
--- a/storage/perfschema/pfs_instr.cc	2011-07-07 14:26:36 +0000
+++ b/storage/perfschema/pfs_instr.cc	2011-07-14 08:11:07 +0000
@@ -1223,7 +1223,7 @@ PFS_table* create_table(PFS_table_share 
           pfs->m_lock_timed= share->m_timed && global_table_lock_class.m_timed;
           share->inc_refcount();
           pfs->m_table_stat.reset();
-          pfs->m_opening_thread= opening_thread;
+          pfs->m_thread_owner= opening_thread;
           pfs->m_lock.dirty_to_allocated();
           return pfs;
         }
@@ -1242,7 +1242,7 @@ void PFS_table::sanitized_aggregate(void
     and not own the table handle.
   */
   PFS_table_share *safe_share= sanitize_table_share(m_share);
-  PFS_thread *safe_thread= sanitize_thread(m_opening_thread);
+  PFS_thread *safe_thread= sanitize_thread(m_thread_owner);
   if (safe_share != NULL && safe_thread != NULL)
     safe_aggregate(& m_table_stat, safe_share, safe_thread);
 }
@@ -1250,7 +1250,7 @@ void PFS_table::sanitized_aggregate(void
 void PFS_table::sanitized_aggregate_io(void)
 {
   PFS_table_share *safe_share= sanitize_table_share(m_share);
-  PFS_thread *safe_thread= sanitize_thread(m_opening_thread);
+  PFS_thread *safe_thread= sanitize_thread(m_thread_owner);
   if (safe_share != NULL && safe_thread != NULL)
     safe_aggregate_io(& m_table_stat, safe_share, safe_thread);
 }
@@ -1258,7 +1258,7 @@ void PFS_table::sanitized_aggregate_io(v
 void PFS_table::sanitized_aggregate_lock(void)
 {
   PFS_table_share *safe_share= sanitize_table_share(m_share);
-  PFS_thread *safe_thread= sanitize_thread(m_opening_thread);
+  PFS_thread *safe_thread= sanitize_thread(m_thread_owner);
   if (safe_share != NULL && safe_thread != NULL)
     safe_aggregate_lock(& m_table_stat, safe_share, safe_thread);
 }

=== modified file 'storage/perfschema/pfs_instr.h'
--- a/storage/perfschema/pfs_instr.h	2011-07-06 18:58:53 +0000
+++ b/storage/perfschema/pfs_instr.h	2011-07-07 19:13:19 +0000
@@ -170,7 +170,10 @@ public:
     @sa sanitized_aggregate.
   */
   void aggregate(void)
-  { return safe_aggregate(& m_table_stat, m_share, m_opening_thread); }
+  {
+    if (likely(m_thread_owner != NULL))
+      safe_aggregate(& m_table_stat, m_share, m_thread_owner);
+  }
 
   /**
     Aggregate this table handle statistics to the parents.
@@ -196,7 +199,7 @@ public:
   /** Internal lock. */
   pfs_lock m_lock;
   /** Owner. */
-  PFS_thread *m_opening_thread;
+  PFS_thread *m_thread_owner;
   /** Table share. */
   PFS_table_share *m_share;
   /** Table identity, typically a handler. */

=== modified file 'storage/perfschema/pfs_setup_object.cc'
--- a/storage/perfschema/pfs_setup_object.cc	2010-09-24 21:04:59 +0000
+++ b/storage/perfschema/pfs_setup_object.cc	2011-05-05 06:11:49 +0000
@@ -251,7 +251,7 @@ int reset_setup_object()
 
   for ( ; pfs < pfs_last; pfs++)
   {
-    if (pfs->m_enabled && pfs->m_lock.is_populated())
+    if (pfs->m_lock.is_populated())
     {
       lf_hash_delete(&setup_object_hash, pins,
                      pfs->m_key.m_hash_key, pfs->m_key.m_key_length);

=== modified file 'storage/perfschema/table_setup_objects.cc'
--- a/storage/perfschema/table_setup_objects.cc	2011-07-06 18:58:53 +0000
+++ b/storage/perfschema/table_setup_objects.cc	2011-07-14 09:53:42 +0000
@@ -47,13 +47,11 @@ static const TABLE_FIELD_TYPE field_type
     { C_STRING_WITH_LEN("varchar(64)") },
     { NULL, 0}
   },
-#if 0
   {
     { C_STRING_WITH_LEN("ENABLED") },
     { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
     { NULL, 0}
   },
-#endif
   {
     { C_STRING_WITH_LEN("TIMED") },
     { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
@@ -63,7 +61,7 @@ static const TABLE_FIELD_TYPE field_type
 
 TABLE_FIELD_DEF
 table_setup_objects::m_field_def=
-{ 4, field_types };
+{ 5, field_types };
 
 PFS_engine_table_share
 table_setup_objects::m_share=
@@ -107,7 +105,8 @@ int table_setup_objects::write_row(TABLE
   String object_name_data("%", 1, &my_charset_utf8_bin);
   String *object_schema= &object_schema_data;
   String *object_name= &object_name_data;
-  enum_yes_no yes_no;
+  enum_yes_no enabled_value= ENUM_YES;
+  enum_yes_no timed_value= ENUM_YES;
   bool enabled= true;
   bool timed= true;
 
@@ -126,15 +125,11 @@ int table_setup_objects::write_row(TABLE
       case 2: /* OBJECT_NAME */
         object_name= get_field_varchar_utf8(f, &object_name_data);
         break;
-#if 0
       case 3: /* ENABLED */
-        yes_no= (enum_yes_no) get_field_enum(f);
-        enabled= (yes_no == ENUM_YES) ? true : false;
+        enabled_value= (enum_yes_no) get_field_enum(f);
         break;
-#endif
-      case 3: /* TIMED */
-        yes_no= (enum_yes_no) get_field_enum(f);
-        timed= (yes_no == ENUM_YES) ? true : false;
+      case 4: /* TIMED */
+        timed_value= (enum_yes_no) get_field_enum(f);
         break;
       default:
         DBUG_ASSERT(false);
@@ -146,6 +141,17 @@ int table_setup_objects::write_row(TABLE
   if (object_type != OBJECT_TYPE_TABLE)
     return HA_ERR_NO_REFERENCED_ROW;
 
+  /* Reject illegal enum values in ENABLED */
+  if ((enabled_value != ENUM_YES) && (enabled_value != ENUM_NO))
+    return HA_ERR_NO_REFERENCED_ROW;
+
+  /* Reject illegal enum values in TIMED */
+  if ((timed_value != ENUM_YES) && (timed_value != ENUM_NO))
+    return HA_ERR_NO_REFERENCED_ROW;
+
+  enabled= (enabled_value == ENUM_YES) ? true : false;
+  timed= (timed_value == ENUM_YES) ? true : false;
+
   result= insert_setup_object(object_type, object_schema, object_name,
                               enabled, timed);
   if (result == 0)
@@ -227,17 +233,7 @@ void table_setup_objects::make_row(PFS_s
   m_row.m_schema_name_length= pfs->m_schema_name_length;
   memcpy(m_row.m_object_name, pfs->m_object_name, pfs->m_object_name_length);
   m_row.m_object_name_length= pfs->m_object_name_length;
-#if 0
   m_row.m_enabled_ptr= &pfs->m_enabled;
-#else
-  /*
-    The ENABLED column does not exist,
-    so disabled records are be displayed.
-  */
-  if (! pfs->m_enabled)
-    return;
-#endif
-
   m_row.m_timed_ptr= &pfs->m_timed;
 
   if (pfs->m_lock.end_optimistic_lock(&lock))
@@ -281,12 +277,10 @@ int table_setup_objects::read_row_values
         else
           f->set_null();
         break;
-#if 0
       case 3: /* ENABLED */
         set_field_enum(f, (*m_row.m_enabled_ptr) ? ENUM_YES : ENUM_NO);
         break;
-#endif
-      case 3: /* TIMED */
+      case 4: /* TIMED */
         set_field_enum(f, (*m_row.m_timed_ptr) ? ENUM_YES : ENUM_NO);
         break;
       default:
@@ -317,14 +311,18 @@ int table_setup_objects::update_row_valu
       case 1: /* OBJECT_SCHEMA */
       case 2: /* OBJECT_NAME */
         return HA_ERR_WRONG_COMMAND;
-#if 0
       case 3: /* ENABLED */
         value= (enum_yes_no) get_field_enum(f);
+        /* Reject illegal enum values in ENABLED */
+        if ((value != ENUM_YES) && (value != ENUM_NO))
+          return HA_ERR_NO_REFERENCED_ROW;
         *m_row.m_enabled_ptr= (value == ENUM_YES) ? true : false;
         break;
-#endif
-      case 3: /* TIMED */
+      case 4: /* TIMED */
         value= (enum_yes_no) get_field_enum(f);
+        /* Reject illegal enum values in TIMED */
+        if ((value != ENUM_YES) && (value != ENUM_NO))
+          return HA_ERR_NO_REFERENCED_ROW;
         *m_row.m_timed_ptr= (value == ENUM_YES) ? true : false;
         break;
       default:

=== modified file 'storage/perfschema/table_setup_objects.h'
--- a/storage/perfschema/table_setup_objects.h	2010-09-23 16:08:54 +0000
+++ b/storage/perfschema/table_setup_objects.h	2011-05-05 06:11:49 +0000
@@ -44,10 +44,8 @@ struct row_setup_objects
   char m_object_name[NAME_LEN];
   /** Length in bytes of @c m_object_name. */
   uint m_object_name_length;
-#if 0
   /** Column ENABLED. */
   bool *m_enabled_ptr;
-#endif
   /** Column TIMED. */
   bool *m_timed_ptr;
 };

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (marc.alff:3262 to 3263) Marc Alff17 Jul