List:Commits« Previous MessageNext Message »
From:Marc Alff Date:August 12 2010 3:54pm
Subject:bzr push into mysql-next-mr-bugfixing branch (marc.alff:3207 to 3208)
View as plain text  
 3208 Marc Alff	2010-08-12 [merge]
      Merge mysql-trunk-bugfixing --> mysql-next-mr-bugfixing

    removed:
      mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result
      mysql-test/suite/perfschema/r/ddl_processlist.result
      mysql-test/suite/perfschema/r/ddl_setup_objects.result
      mysql-test/suite/perfschema/r/dml_ews_by_event_name.result
      mysql-test/suite/perfschema/r/dml_processlist.result
      mysql-test/suite/perfschema/r/dml_setup_objects.result
      mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_processlist.test
      mysql-test/suite/perfschema/t/ddl_setup_objects.test
      mysql-test/suite/perfschema/t/dml_ews_by_event_name.test
      mysql-test/suite/perfschema/t/dml_processlist.test
      mysql-test/suite/perfschema/t/dml_setup_objects.test
      storage/perfschema/table_processlist.cc
      storage/perfschema/table_processlist.h
      storage/perfschema/table_setup_objects.cc
      storage/perfschema/table_setup_objects.h
    added:
      mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result
      mysql-test/suite/perfschema/r/ddl_threads.result
      mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result
      mysql-test/suite/perfschema/r/dml_threads.result
      mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test
      mysql-test/suite/perfschema/t/ddl_threads.test
      mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test
      mysql-test/suite/perfschema/t/dml_threads.test
      storage/perfschema/table_ews_global_by_event_name.cc
      storage/perfschema/table_ews_global_by_event_name.h
      storage/perfschema/table_threads.cc
      storage/perfschema/table_threads.h
    modified:
      mysql-test/suite/perfschema/include/setup_helper.inc
      mysql-test/suite/perfschema/include/start_server_common.inc
      mysql-test/suite/perfschema/r/aggregate.result
      mysql-test/suite/perfschema/r/func_file_io.result
      mysql-test/suite/perfschema/r/information_schema.result
      mysql-test/suite/perfschema/r/misc.result
      mysql-test/suite/perfschema/r/no_threads.result
      mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result
      mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result
      mysql-test/suite/perfschema/r/pfs_upgrade_lc2.result
      mysql-test/suite/perfschema/r/schema.result
      mysql-test/suite/perfschema/r/selects.result
      mysql-test/suite/perfschema/r/start_server_no_cond_class.result
      mysql-test/suite/perfschema/r/start_server_no_cond_inst.result
      mysql-test/suite/perfschema/r/start_server_no_file_class.result
      mysql-test/suite/perfschema/r/start_server_no_file_inst.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_class.result
      mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result
      mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result
      mysql-test/suite/perfschema/r/start_server_no_table_hdl.result
      mysql-test/suite/perfschema/r/start_server_no_table_inst.result
      mysql-test/suite/perfschema/r/start_server_no_thread_class.result
      mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
      mysql-test/suite/perfschema/r/start_server_nothing.result
      mysql-test/suite/perfschema/r/start_server_off.result
      mysql-test/suite/perfschema/r/start_server_on.result
      mysql-test/suite/perfschema/t/aggregate.test
      mysql-test/suite/perfschema/t/func_file_io.test
      mysql-test/suite/perfschema/t/misc.test
      mysql-test/suite/perfschema/t/no_threads.test
      mysql-test/suite/perfschema/t/schema.test
      mysql-test/suite/perfschema/t/selects.test
      mysql-test/suite/perfschema/t/start_server_no_thread_class.test
      mysql-test/suite/perfschema/t/start_server_no_thread_inst.test
      mysql-test/suite/perfschema/t/start_server_nothing.test
      mysql-test/suite/perfschema/t/thread_cache.test
      scripts/mysql_system_tables.sql
      storage/perfschema/CMakeLists.txt
      storage/perfschema/Makefile.am
      storage/perfschema/pfs_engine_table.cc
      storage/perfschema/table_events_waits_summary.cc
      storage/perfschema/table_events_waits_summary.h
 3207 Alexander Nozdrin	2010-08-12 [merge]
      Auto-merge from mysql-trunk-bugfixing.

    modified:
      sql/sp_head.cc
=== modified file 'mysql-test/suite/perfschema/include/setup_helper.inc'
--- a/mysql-test/suite/perfschema/include/setup_helper.inc	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/include/setup_helper.inc	2010-08-12 15:25:01 +0000
@@ -25,17 +25,17 @@ update performance_schema.SETUP_CONSUMER
 
 connect (con1, localhost, root, , );
 
-let $con1_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID in (select connection_id())`;
 
 connect (con2, localhost, root, , );
 
-let $con2_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID in (select connection_id())`;
 
 connect (con3, localhost, root, , );
 
-let $con3_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID in (select connection_id())`;
 
 connection default;
@@ -49,6 +49,6 @@ prepare stmt_dump_events from
   where thread_id=? order by event_id;";
 
 prepare stmt_dump_thread from
-  "select name from performance_schema.PROCESSLIST where thread_id=? ;";
+  "select name from performance_schema.THREADS where thread_id=? ;";
 --enable_query_log
 

=== modified file 'mysql-test/suite/perfschema/include/start_server_common.inc'
--- a/mysql-test/suite/perfschema/include/start_server_common.inc	2010-06-15 14:46:02 +0000
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc	2010-08-12 15:25:01 +0000
@@ -30,20 +30,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 --enable_result_log
 
 # This has a stable output, printing the result:

=== modified file 'mysql-test/suite/perfschema/r/aggregate.result'
--- a/mysql-test/suite/perfschema/r/aggregate.result	2010-01-27 15:26:05 +0000
+++ b/mysql-test/suite/perfschema/r/aggregate.result	2010-08-12 14:08:52 +0000
@@ -4,7 +4,7 @@ update performance_schema.SETUP_INSTRUME
 update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
 truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
+truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
 update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
@@ -49,14 +49,14 @@ OR @dump_all;
 EVENT_NAME	SUM_NUMBER_OF_BYTES_WRITE	SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
 "Verifying waits aggregate consistency (instance)"
 SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
 GROUP BY EVENT_NAME
 HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
 OR @dump_all;
 EVENT_NAME	SUM_TIMER_WAIT	SUM(i.SUM_TIMER_WAIT)
 SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
 GROUP BY EVENT_NAME
 HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
@@ -64,7 +64,7 @@ AND (MIN(i.MIN_TIMER_WAIT) != 0)
 OR @dump_all;
 EVENT_NAME	MIN_TIMER_WAIT	MIN(i.MIN_TIMER_WAIT)
 SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
 GROUP BY EVENT_NAME
 HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
@@ -72,7 +72,7 @@ OR @dump_all;
 EVENT_NAME	MAX_TIMER_WAIT	MAX(i.MAX_TIMER_WAIT)
 "Verifying waits aggregate consistency (thread)"
 SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
 USING (EVENT_NAME)
 GROUP BY EVENT_NAME
@@ -80,7 +80,7 @@ HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIM
 OR @dump_all;
 EVENT_NAME	SUM_TIMER_WAIT	SUM(t.SUM_TIMER_WAIT)
 SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
 USING (EVENT_NAME)
 GROUP BY EVENT_NAME
@@ -89,7 +89,7 @@ AND (MIN(t.MIN_TIMER_WAIT) != 0)
 OR @dump_all;
 EVENT_NAME	MIN_TIMER_WAIT	MIN(t.MIN_TIMER_WAIT)
 SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
 USING (EVENT_NAME)
 GROUP BY EVENT_NAME

=== removed file 'mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result'
--- a/mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result	1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
-alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME add column foo integer;
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(EVENT_NAME);
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME(EVENT_NAME);
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

=== added file 'mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result'
--- a/mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_ews_global_by_event_name.result	2010-08-12 14:08:52 +0000
@@ -0,0 +1,10 @@
+alter table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+ADD INDEX test_index(EVENT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index
+ON performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME(EVENT_NAME);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

=== removed file 'mysql-test/suite/perfschema/r/ddl_processlist.result'
--- a/mysql-test/suite/perfschema/r/ddl_processlist.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_processlist.result	1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
-alter table performance_schema.PROCESSLIST add column foo integer;
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.PROCESSLIST;
-ERROR HY000: Invalid performance_schema usage.
-ALTER TABLE performance_schema.PROCESSLIST ADD INDEX test_index(ID);
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.PROCESSLIST(ID);
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

=== removed file 'mysql-test/suite/perfschema/r/ddl_setup_objects.result'
--- a/mysql-test/suite/perfschema/r/ddl_setup_objects.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_setup_objects.result	1970-01-01 00:00:00 +0000
@@ -1,7 +0,0 @@
-alter table performance_schema.SETUP_OBJECTS add column foo integer;
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-truncate table performance_schema.SETUP_OBJECTS;
-ALTER TABLE performance_schema.SETUP_OBJECTS ADD INDEX test_index(OBJECT_NAME);
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_OBJECTS(OBJECT_NAME);
-ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

=== added file 'mysql-test/suite/perfschema/r/ddl_threads.result'
--- a/mysql-test/suite/perfschema/r/ddl_threads.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_threads.result	2010-08-12 14:08:52 +0000
@@ -0,0 +1,8 @@
+alter table performance_schema.THREADS add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+truncate table performance_schema.THREADS;
+ERROR HY000: Invalid performance_schema usage.
+ALTER TABLE performance_schema.THREADS ADD INDEX test_index(ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.THREADS(ID);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'

=== removed file 'mysql-test/suite/perfschema/r/dml_ews_by_event_name.result'
--- a/mysql-test/suite/perfschema/r/dml_ews_by_event_name.result	2010-03-18 15:35:06 +0000
+++ b/mysql-test/suite/perfschema/r/dml_ews_by_event_name.result	1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-where event_name like 'Wait/Synch/%' limit 1;
-EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
-#	#	#	#	#	#
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-where event_name='FOO';
-EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
-insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
-avg_timer_wait=4, max_timer_wait=5;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-set count_star=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-set count_star=12 where event_name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-where count_star=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME READ;
-ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
-UNLOCK TABLES;
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME WRITE;
-ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
-UNLOCK TABLES;

=== added file 'mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result'
--- a/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/dml_ews_global_by_event_name.result	2010-08-12 15:25:01 +0000
@@ -0,0 +1,28 @@
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+where event_name like 'Wait/Synch/%' limit 1;
+EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
+#	#	#	#	#	#
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+where event_name='FOO';
+EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
+insert into performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+avg_timer_wait=4, max_timer_wait=5;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+set count_star=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+set count_star=12 where event_name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+where count_star=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+UNLOCK TABLES;

=== removed file 'mysql-test/suite/perfschema/r/dml_processlist.result'
--- a/mysql-test/suite/perfschema/r/dml_processlist.result	2010-03-18 15:35:06 +0000
+++ b/mysql-test/suite/perfschema/r/dml_processlist.result	1970-01-01 00:00:00 +0000
@@ -1,27 +0,0 @@
-select * from performance_schema.PROCESSLIST
-where name like 'Thread/%' limit 1;
-THREAD_ID	ID	NAME
-#	#	#
-select * from performance_schema.PROCESSLIST
-where name='FOO';
-THREAD_ID	ID	NAME
-insert into performance_schema.PROCESSLIST
-set name='FOO', thread_id=1, id=2;
-ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'PROCESSLIST'
-update performance_schema.PROCESSLIST
-set thread_id=12;
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
-update performance_schema.PROCESSLIST
-set thread_id=12 where name like "FOO";
-ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
-delete from performance_schema.PROCESSLIST
-where id=1;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
-delete from performance_schema.PROCESSLIST;
-ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PROCESSLIST'
-LOCK TABLES performance_schema.PROCESSLIST READ;
-ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'PROCESSLIST'
-UNLOCK TABLES;
-LOCK TABLES performance_schema.PROCESSLIST WRITE;
-ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'PROCESSLIST'
-UNLOCK TABLES;

=== removed file 'mysql-test/suite/perfschema/r/dml_setup_objects.result'
--- a/mysql-test/suite/perfschema/r/dml_setup_objects.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/dml_setup_objects.result	1970-01-01 00:00:00 +0000
@@ -1,35 +0,0 @@
-select * from performance_schema.SETUP_OBJECTS;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED	AGGREGATED
-select * from performance_schema.SETUP_OBJECTS
-where object_type = 'TABLE';
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED	AGGREGATED
-select * from performance_schema.SETUP_OBJECTS
-where enabled='YES';
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED	AGGREGATED
-insert into performance_schema.SETUP_OBJECTS
-set object_type='TABLE', object_schema='FOO', object_name='BAR',
-enabled='YES', timed='YES', aggregated='YES';
-ERROR HY000: Table storage engine for 'SETUP_OBJECTS' doesn't have this option
-update performance_schema.SETUP_OBJECTS
-set object_type='TABLE';
-update performance_schema.SETUP_OBJECTS
-set object_schema='ILLEGAL';
-update performance_schema.SETUP_OBJECTS
-set object_name='ILLEGAL';
-update performance_schema.SETUP_OBJECTS
-set enabled='NO';
-update performance_schema.SETUP_OBJECTS
-set timed='NO';
-update performance_schema.SETUP_OBJECTS
-set aggregated='NO';
-select * from performance_schema.SETUP_OBJECTS;
-OBJECT_TYPE	OBJECT_SCHEMA	OBJECT_NAME	ENABLED	TIMED	AGGREGATED
-update performance_schema.SETUP_OBJECTS
-set enabled='YES', timed='YES', aggregated='YES';
-delete from performance_schema.SETUP_OBJECTS
-where object_type = 'TABLE';
-delete from performance_schema.SETUP_OBJECTS;
-LOCK TABLES performance_schema.SETUP_OBJECTS READ;
-UNLOCK TABLES;
-LOCK TABLES performance_schema.SETUP_OBJECTS WRITE;
-UNLOCK TABLES;

=== added file 'mysql-test/suite/perfschema/r/dml_threads.result'
--- a/mysql-test/suite/perfschema/r/dml_threads.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/dml_threads.result	2010-08-12 15:25:01 +0000
@@ -0,0 +1,27 @@
+select * from performance_schema.THREADS
+where name like 'Thread/%' limit 1;
+THREAD_ID	ID	NAME
+#	#	#
+select * from performance_schema.THREADS
+where name='FOO';
+THREAD_ID	ID	NAME
+insert into performance_schema.THREADS
+set name='FOO', thread_id=1, id=2;
+ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'THREADS'
+update performance_schema.THREADS
+set thread_id=12;
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'THREADS'
+update performance_schema.THREADS
+set thread_id=12 where name like "FOO";
+ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'THREADS'
+delete from performance_schema.THREADS
+where id=1;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'THREADS'
+delete from performance_schema.THREADS;
+ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'THREADS'
+LOCK TABLES performance_schema.THREADS READ;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'THREADS'
+UNLOCK TABLES;
+LOCK TABLES performance_schema.THREADS WRITE;
+ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'THREADS'
+UNLOCK TABLES;

=== modified file 'mysql-test/suite/perfschema/r/func_file_io.result'
--- a/mysql-test/suite/perfschema/r/func_file_io.result	2010-05-05 08:16:47 +0000
+++ b/mysql-test/suite/perfschema/r/func_file_io.result	2010-08-12 15:25:01 +0000
@@ -90,27 +90,27 @@ SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_nu
 FROM performance_schema.FILE_SUMMARY_BY_INSTANCE
 WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL;
 SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
 WHERE COUNT_STAR > 0
 ORDER BY SUM_TIMER_WAIT DESC
 LIMIT 10;
 SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
 # ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
 FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
+INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
 LEFT JOIN information_schema.PROCESSLIST i USING (ID)
 GROUP BY i.user
 ORDER BY SUM_WAIT DESC
 LIMIT 20;
 SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
 FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
+INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
 WHERE p.ID = 1
 GROUP BY h.EVENT_NAME
 HAVING TOTAL_WAIT > 0;
 SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
 FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
+INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
 LEFT JOIN information_schema.PROCESSLIST i USING (ID)
 GROUP BY i.user, h.operation
 HAVING BYTES > 0

=== modified file 'mysql-test/suite/perfschema/r/information_schema.result'
--- a/mysql-test/suite/perfschema/r/information_schema.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/information_schema.result	2010-08-12 14:08:52 +0000
@@ -6,20 +6,19 @@ performance_schema	COND_INSTANCES	def
 performance_schema	EVENTS_WAITS_CURRENT	def
 performance_schema	EVENTS_WAITS_HISTORY	def
 performance_schema	EVENTS_WAITS_HISTORY_LONG	def
-performance_schema	EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	def
 performance_schema	EVENTS_WAITS_SUMMARY_BY_INSTANCE	def
 performance_schema	EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	def
+performance_schema	EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	def
 performance_schema	FILE_INSTANCES	def
 performance_schema	FILE_SUMMARY_BY_EVENT_NAME	def
 performance_schema	FILE_SUMMARY_BY_INSTANCE	def
 performance_schema	MUTEX_INSTANCES	def
 performance_schema	PERFORMANCE_TIMERS	def
-performance_schema	PROCESSLIST	def
 performance_schema	RWLOCK_INSTANCES	def
 performance_schema	SETUP_CONSUMERS	def
 performance_schema	SETUP_INSTRUMENTS	def
-performance_schema	SETUP_OBJECTS	def
 performance_schema	SETUP_TIMERS	def
+performance_schema	THREADS	def
 select upper(TABLE_NAME), TABLE_TYPE, ENGINE
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -28,20 +27,19 @@ COND_INSTANCES	BASE TABLE	PERFORMANCE_SC
 EVENTS_WAITS_CURRENT	BASE TABLE	PERFORMANCE_SCHEMA
 EVENTS_WAITS_HISTORY	BASE TABLE	PERFORMANCE_SCHEMA
 EVENTS_WAITS_HISTORY_LONG	BASE TABLE	PERFORMANCE_SCHEMA
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	BASE TABLE	PERFORMANCE_SCHEMA
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	BASE TABLE	PERFORMANCE_SCHEMA
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	BASE TABLE	PERFORMANCE_SCHEMA
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	BASE TABLE	PERFORMANCE_SCHEMA
 FILE_INSTANCES	BASE TABLE	PERFORMANCE_SCHEMA
 FILE_SUMMARY_BY_EVENT_NAME	BASE TABLE	PERFORMANCE_SCHEMA
 FILE_SUMMARY_BY_INSTANCE	BASE TABLE	PERFORMANCE_SCHEMA
 MUTEX_INSTANCES	BASE TABLE	PERFORMANCE_SCHEMA
 PERFORMANCE_TIMERS	BASE TABLE	PERFORMANCE_SCHEMA
-PROCESSLIST	BASE TABLE	PERFORMANCE_SCHEMA
 RWLOCK_INSTANCES	BASE TABLE	PERFORMANCE_SCHEMA
 SETUP_CONSUMERS	BASE TABLE	PERFORMANCE_SCHEMA
 SETUP_INSTRUMENTS	BASE TABLE	PERFORMANCE_SCHEMA
-SETUP_OBJECTS	BASE TABLE	PERFORMANCE_SCHEMA
 SETUP_TIMERS	BASE TABLE	PERFORMANCE_SCHEMA
+THREADS	BASE TABLE	PERFORMANCE_SCHEMA
 select upper(TABLE_NAME), VERSION, ROW_FORMAT
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -50,20 +48,19 @@ COND_INSTANCES	10	Dynamic
 EVENTS_WAITS_CURRENT	10	Dynamic
 EVENTS_WAITS_HISTORY	10	Dynamic
 EVENTS_WAITS_HISTORY_LONG	10	Dynamic
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	10	Dynamic
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	10	Dynamic
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	10	Dynamic
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	10	Dynamic
 FILE_INSTANCES	10	Dynamic
 FILE_SUMMARY_BY_EVENT_NAME	10	Dynamic
 FILE_SUMMARY_BY_INSTANCE	10	Dynamic
 MUTEX_INSTANCES	10	Dynamic
 PERFORMANCE_TIMERS	10	Fixed
-PROCESSLIST	10	Dynamic
 RWLOCK_INSTANCES	10	Dynamic
 SETUP_CONSUMERS	10	Dynamic
 SETUP_INSTRUMENTS	10	Dynamic
-SETUP_OBJECTS	10	Dynamic
 SETUP_TIMERS	10	Dynamic
+THREADS	10	Dynamic
 select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -72,20 +69,19 @@ COND_INSTANCES	1000	0
 EVENTS_WAITS_CURRENT	1000	0
 EVENTS_WAITS_HISTORY	1000	0
 EVENTS_WAITS_HISTORY_LONG	10000	0
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	1000	0
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	1000	0
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	1000	0
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	1000	0
 FILE_INSTANCES	1000	0
 FILE_SUMMARY_BY_EVENT_NAME	1000	0
 FILE_SUMMARY_BY_INSTANCE	1000	0
 MUTEX_INSTANCES	1000	0
 PERFORMANCE_TIMERS	5	0
-PROCESSLIST	1000	0
 RWLOCK_INSTANCES	1000	0
 SETUP_CONSUMERS	8	0
 SETUP_INSTRUMENTS	1000	0
-SETUP_OBJECTS	1000	0
 SETUP_TIMERS	1	0
+THREADS	1000	0
 select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -94,20 +90,19 @@ COND_INSTANCES	0	0
 EVENTS_WAITS_CURRENT	0	0
 EVENTS_WAITS_HISTORY	0	0
 EVENTS_WAITS_HISTORY_LONG	0	0
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	0	0
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	0	0
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	0	0
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	0	0
 FILE_INSTANCES	0	0
 FILE_SUMMARY_BY_EVENT_NAME	0	0
 FILE_SUMMARY_BY_INSTANCE	0	0
 MUTEX_INSTANCES	0	0
 PERFORMANCE_TIMERS	0	0
-PROCESSLIST	0	0
 RWLOCK_INSTANCES	0	0
 SETUP_CONSUMERS	0	0
 SETUP_INSTRUMENTS	0	0
-SETUP_OBJECTS	0	0
 SETUP_TIMERS	0	0
+THREADS	0	0
 select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -116,20 +111,19 @@ COND_INSTANCES	0	0	NULL
 EVENTS_WAITS_CURRENT	0	0	NULL
 EVENTS_WAITS_HISTORY	0	0	NULL
 EVENTS_WAITS_HISTORY_LONG	0	0	NULL
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	0	0	NULL
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	0	0	NULL
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	0	0	NULL
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	0	0	NULL
 FILE_INSTANCES	0	0	NULL
 FILE_SUMMARY_BY_EVENT_NAME	0	0	NULL
 FILE_SUMMARY_BY_INSTANCE	0	0	NULL
 MUTEX_INSTANCES	0	0	NULL
 PERFORMANCE_TIMERS	0	0	NULL
-PROCESSLIST	0	0	NULL
 RWLOCK_INSTANCES	0	0	NULL
 SETUP_CONSUMERS	0	0	NULL
 SETUP_INSTRUMENTS	0	0	NULL
-SETUP_OBJECTS	0	0	NULL
 SETUP_TIMERS	0	0	NULL
+THREADS	0	0	NULL
 select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -138,20 +132,19 @@ COND_INSTANCES	NULL	NULL	NULL
 EVENTS_WAITS_CURRENT	NULL	NULL	NULL
 EVENTS_WAITS_HISTORY	NULL	NULL	NULL
 EVENTS_WAITS_HISTORY_LONG	NULL	NULL	NULL
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	NULL	NULL	NULL
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	NULL	NULL	NULL
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	NULL	NULL	NULL
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	NULL	NULL	NULL
 FILE_INSTANCES	NULL	NULL	NULL
 FILE_SUMMARY_BY_EVENT_NAME	NULL	NULL	NULL
 FILE_SUMMARY_BY_INSTANCE	NULL	NULL	NULL
 MUTEX_INSTANCES	NULL	NULL	NULL
 PERFORMANCE_TIMERS	NULL	NULL	NULL
-PROCESSLIST	NULL	NULL	NULL
 RWLOCK_INSTANCES	NULL	NULL	NULL
 SETUP_CONSUMERS	NULL	NULL	NULL
 SETUP_INSTRUMENTS	NULL	NULL	NULL
-SETUP_OBJECTS	NULL	NULL	NULL
 SETUP_TIMERS	NULL	NULL	NULL
+THREADS	NULL	NULL	NULL
 select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -160,20 +153,19 @@ COND_INSTANCES	utf8_general_ci	NULL
 EVENTS_WAITS_CURRENT	utf8_general_ci	NULL
 EVENTS_WAITS_HISTORY	utf8_general_ci	NULL
 EVENTS_WAITS_HISTORY_LONG	utf8_general_ci	NULL
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	utf8_general_ci	NULL
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	utf8_general_ci	NULL
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	utf8_general_ci	NULL
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	utf8_general_ci	NULL
 FILE_INSTANCES	utf8_general_ci	NULL
 FILE_SUMMARY_BY_EVENT_NAME	utf8_general_ci	NULL
 FILE_SUMMARY_BY_INSTANCE	utf8_general_ci	NULL
 MUTEX_INSTANCES	utf8_general_ci	NULL
 PERFORMANCE_TIMERS	utf8_general_ci	NULL
-PROCESSLIST	utf8_general_ci	NULL
 RWLOCK_INSTANCES	utf8_general_ci	NULL
 SETUP_CONSUMERS	utf8_general_ci	NULL
 SETUP_INSTRUMENTS	utf8_general_ci	NULL
-SETUP_OBJECTS	utf8_general_ci	NULL
 SETUP_TIMERS	utf8_general_ci	NULL
+THREADS	utf8_general_ci	NULL
 select upper(TABLE_NAME), TABLE_COMMENT
 from information_schema.tables
 where TABLE_SCHEMA='performance_schema';
@@ -182,17 +174,16 @@ COND_INSTANCES	
 EVENTS_WAITS_CURRENT	
 EVENTS_WAITS_HISTORY	
 EVENTS_WAITS_HISTORY_LONG	
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	
 EVENTS_WAITS_SUMMARY_BY_INSTANCE	
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	
 FILE_INSTANCES	
 FILE_SUMMARY_BY_EVENT_NAME	
 FILE_SUMMARY_BY_INSTANCE	
 MUTEX_INSTANCES	
 PERFORMANCE_TIMERS	
-PROCESSLIST	
 RWLOCK_INSTANCES	
 SETUP_CONSUMERS	
 SETUP_INSTRUMENTS	
-SETUP_OBJECTS	
 SETUP_TIMERS	
+THREADS	

=== modified file 'mysql-test/suite/perfschema/r/misc.result'
--- a/mysql-test/suite/perfschema/r/misc.result	2010-07-16 01:28:30 +0000
+++ b/mysql-test/suite/perfschema/r/misc.result	2010-08-12 15:25:01 +0000
@@ -1,6 +1,6 @@
 SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
 WHERE THREAD_ID IN
-(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
+(SELECT THREAD_ID FROM performance_schema.THREADS)
 AND EVENT_NAME IN
 (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
 WHERE NAME LIKE "wait/synch/%")

=== modified file 'mysql-test/suite/perfschema/r/no_threads.result'
--- a/mysql-test/suite/perfschema/r/no_threads.result	2010-05-05 08:16:47 +0000
+++ b/mysql-test/suite/perfschema/r/no_threads.result	2010-08-12 15:25:01 +0000
@@ -17,11 +17,11 @@ show variables like "performance_schema_
 Variable_name	Value
 performance_schema_max_thread_classes	50
 performance_schema_max_thread_instances	10
-select count(*) from performance_schema.PROCESSLIST
+select count(*) from performance_schema.THREADS
 where name like "thread/sql/main";
 count(*)
 1
-select count(*) from performance_schema.PROCESSLIST
+select count(*) from performance_schema.THREADS
 where name like "thread/sql/OneConnection";
 count(*)
 0

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	2010-07-23 17:20:00 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc0.result	2010-08-12 15:25:01 +0000
@@ -12,21 +12,20 @@ ERROR 1050 (42S01) at line 67: Table 'CO
 ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
 ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
 ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 146: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 159: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
 ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
 ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
 ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
-ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
-ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 240: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 257: Table 'SETUP_TIMERS' already exists
+ERROR 1050 (42S01) at line 266: Table 'THREADS' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -43,21 +42,20 @@ ERROR 1050 (42S01) at line 67: Table 'CO
 ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
 ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
 ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 146: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 159: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
 ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
 ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
 ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
-ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
-ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 240: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 257: Table 'SETUP_TIMERS' already exists
+ERROR 1050 (42S01) at line 266: Table 'THREADS' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -72,21 +70,20 @@ ERROR 1050 (42S01) at line 67: Table 'CO
 ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
 ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
 ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 146: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 159: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
 ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
 ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
 ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
-ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
-ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 240: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 257: Table 'SETUP_TIMERS' already exists
+ERROR 1050 (42S01) at line 266: Table 'THREADS' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -101,21 +98,20 @@ ERROR 1050 (42S01) at line 67: Table 'CO
 ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
 ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
 ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 146: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 159: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
 ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
 ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
 ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
-ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
-ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 240: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 257: Table 'SETUP_TIMERS' already exists
+ERROR 1050 (42S01) at line 266: Table 'THREADS' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -130,21 +126,20 @@ ERROR 1050 (42S01) at line 67: Table 'CO
 ERROR 1050 (42S01) at line 89: Table 'EVENTS_WAITS_CURRENT' already exists
 ERROR 1050 (42S01) at line 111: Table 'EVENTS_WAITS_HISTORY' already exists
 ERROR 1050 (42S01) at line 133: Table 'EVENTS_WAITS_HISTORY_LONG' already exists
-ERROR 1050 (42S01) at line 145: Table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' already exists
-ERROR 1050 (42S01) at line 158: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
-ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 146: Table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' already exists
+ERROR 1050 (42S01) at line 159: Table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' already exists
+ERROR 1050 (42S01) at line 171: Table 'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 180: Table 'FILE_INSTANCES' already exists
 ERROR 1050 (42S01) at line 191: Table 'FILE_SUMMARY_BY_EVENT_NAME' already exists
 ERROR 1050 (42S01) at line 203: Table 'FILE_SUMMARY_BY_INSTANCE' already exists
 ERROR 1050 (42S01) at line 212: Table 'MUTEX_INSTANCES' already exists
 ERROR 1050 (42S01) at line 222: Table 'PERFORMANCE_TIMERS' already exists
-ERROR 1050 (42S01) at line 231: Table 'PROCESSLIST' already exists
-ERROR 1050 (42S01) at line 241: Table 'RWLOCK_INSTANCES' already exists
-ERROR 1050 (42S01) at line 249: Table 'SETUP_CONSUMERS' already exists
-ERROR 1050 (42S01) at line 261: Table 'SETUP_OBJECTS' already exists
-ERROR 1050 (42S01) at line 270: Table 'SETUP_INSTRUMENTS' already exists
-ERROR 1050 (42S01) at line 278: Table 'SETUP_TIMERS' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'RWLOCK_INSTANCES' already exists
+ERROR 1050 (42S01) at line 240: Table 'SETUP_CONSUMERS' already exists
+ERROR 1050 (42S01) at line 249: Table 'SETUP_INSTRUMENTS' already exists
+ERROR 1050 (42S01) at line 257: Table 'SETUP_TIMERS' already exists
+ERROR 1050 (42S01) at line 266: Table 'THREADS' already exists
+ERROR 1644 (HY000) at line 682: 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/pfs_upgrade_lc1.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	2010-07-23 17:20:00 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc1.result	2010-08-12 15:25:01 +0000
@@ -12,21 +12,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -43,21 +42,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -72,21 +70,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -101,21 +98,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -130,21 +126,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: 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/pfs_upgrade_lc2.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_lc2.result	2010-07-23 17:20:00 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_lc2.result	2010-08-12 15:25:01 +0000
@@ -12,21 +12,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -43,21 +42,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -72,21 +70,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -101,21 +98,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -130,21 +126,20 @@ ERROR 1050 (42S01) at line 67: Table 'co
 ERROR 1050 (42S01) at line 89: Table 'events_waits_current' already exists
 ERROR 1050 (42S01) at line 111: Table 'events_waits_history' already exists
 ERROR 1050 (42S01) at line 133: Table 'events_waits_history_long' already exists
-ERROR 1050 (42S01) at line 145: Table 'events_waits_summary_by_event_name' already exists
-ERROR 1050 (42S01) at line 158: Table 'events_waits_summary_by_instance' already exists
-ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 146: Table 'events_waits_summary_by_instance' already exists
+ERROR 1050 (42S01) at line 159: Table 'events_waits_summary_by_thread_by_event_name' already exists
+ERROR 1050 (42S01) at line 171: Table 'events_waits_summary_global_by_event_name' already exists
 ERROR 1050 (42S01) at line 180: Table 'file_instances' already exists
 ERROR 1050 (42S01) at line 191: Table 'file_summary_by_event_name' already exists
 ERROR 1050 (42S01) at line 203: Table 'file_summary_by_instance' already exists
 ERROR 1050 (42S01) at line 212: Table 'mutex_instances' already exists
 ERROR 1050 (42S01) at line 222: Table 'performance_timers' already exists
-ERROR 1050 (42S01) at line 231: Table 'processlist' already exists
-ERROR 1050 (42S01) at line 241: Table 'rwlock_instances' already exists
-ERROR 1050 (42S01) at line 249: Table 'setup_consumers' already exists
-ERROR 1050 (42S01) at line 261: Table 'setup_objects' already exists
-ERROR 1050 (42S01) at line 270: Table 'setup_instruments' already exists
-ERROR 1050 (42S01) at line 278: Table 'setup_timers' already exists
-ERROR 1644 (HY000) at line 694: Unexpected content found in the performance_schema database.
+ERROR 1050 (42S01) at line 232: Table 'rwlock_instances' already exists
+ERROR 1050 (42S01) at line 240: Table 'setup_consumers' already exists
+ERROR 1050 (42S01) at line 249: Table 'setup_instruments' already exists
+ERROR 1050 (42S01) at line 257: Table 'setup_timers' already exists
+ERROR 1050 (42S01) at line 266: Table 'threads' already exists
+ERROR 1644 (HY000) at line 682: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== modified file 'mysql-test/suite/perfschema/r/schema.result'
--- a/mysql-test/suite/perfschema/r/schema.result	2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/schema.result	2010-08-12 14:08:52 +0000
@@ -12,20 +12,19 @@ COND_INSTANCES
 EVENTS_WAITS_CURRENT
 EVENTS_WAITS_HISTORY
 EVENTS_WAITS_HISTORY_LONG
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
 EVENTS_WAITS_SUMMARY_BY_INSTANCE
 EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
 FILE_INSTANCES
 FILE_SUMMARY_BY_EVENT_NAME
 FILE_SUMMARY_BY_INSTANCE
 MUTEX_INSTANCES
 PERFORMANCE_TIMERS
-PROCESSLIST
 RWLOCK_INSTANCES
 SETUP_CONSUMERS
 SETUP_INSTRUMENTS
-SETUP_OBJECTS
 SETUP_TIMERS
+THREADS
 show create table COND_INSTANCES;
 Table	Create Table
 COND_INSTANCES	CREATE TABLE `COND_INSTANCES` (
@@ -92,31 +91,31 @@ EVENTS_WAITS_HISTORY_LONG	CREATE TABLE `
   `NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL,
   `FLAGS` int(10) unsigned DEFAULT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
+show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 Table	Create Table
-EVENTS_WAITS_SUMMARY_BY_EVENT_NAME	CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_EVENT_NAME` (
+EVENTS_WAITS_SUMMARY_BY_INSTANCE	CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_INSTANCE` (
   `EVENT_NAME` varchar(128) NOT NULL,
+  `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
   `COUNT_STAR` bigint(20) unsigned NOT NULL,
   `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE;
+show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
 Table	Create Table
-EVENTS_WAITS_SUMMARY_BY_INSTANCE	CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_INSTANCE` (
+EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME` (
+  `THREAD_ID` int(11) NOT NULL,
   `EVENT_NAME` varchar(128) NOT NULL,
-  `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
   `COUNT_STAR` bigint(20) unsigned NOT NULL,
   `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL,
   `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+show create table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 Table	Create Table
-EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME	CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME` (
-  `THREAD_ID` int(11) NOT NULL,
+EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME	CREATE TABLE `EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME` (
   `EVENT_NAME` varchar(128) NOT NULL,
   `COUNT_STAR` bigint(20) unsigned NOT NULL,
   `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL,
@@ -165,13 +164,6 @@ PERFORMANCE_TIMERS	CREATE TABLE `PERFORM
   `TIMER_RESOLUTION` bigint(20) DEFAULT NULL,
   `TIMER_OVERHEAD` bigint(20) DEFAULT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table PROCESSLIST;
-Table	Create Table
-PROCESSLIST	CREATE TABLE `PROCESSLIST` (
-  `THREAD_ID` int(11) NOT NULL,
-  `ID` int(11) NOT NULL,
-  `NAME` varchar(64) NOT NULL
-) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
 show create table RWLOCK_INSTANCES;
 Table	Create Table
 RWLOCK_INSTANCES	CREATE TABLE `RWLOCK_INSTANCES` (
@@ -193,19 +185,16 @@ SETUP_INSTRUMENTS	CREATE TABLE `SETUP_IN
   `ENABLED` enum('YES','NO') NOT NULL,
   `TIMED` enum('YES','NO') NOT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
-show create table SETUP_OBJECTS;
-Table	Create Table
-SETUP_OBJECTS	CREATE TABLE `SETUP_OBJECTS` (
-  `OBJECT_TYPE` varchar(64) DEFAULT NULL,
-  `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
-  `OBJECT_NAME` varchar(64) DEFAULT NULL,
-  `ENABLED` enum('YES','NO') NOT NULL,
-  `TIMED` enum('YES','NO') NOT NULL,
-  `AGGREGATED` enum('YES','NO') NOT NULL
-) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
 show create table SETUP_TIMERS;
 Table	Create Table
 SETUP_TIMERS	CREATE TABLE `SETUP_TIMERS` (
   `NAME` varchar(64) NOT NULL,
   `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL
 ) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table THREADS;
+Table	Create Table
+THREADS	CREATE TABLE `THREADS` (
+  `THREAD_ID` int(11) NOT NULL,
+  `ID` int(11) NOT NULL,
+  `NAME` varchar(64) NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8

=== modified file 'mysql-test/suite/perfschema/r/selects.result'
--- a/mysql-test/suite/perfschema/r/selects.result	2010-07-29 13:37:49 +0000
+++ b/mysql-test/suite/perfschema/r/selects.result	2010-08-12 15:25:01 +0000
@@ -15,7 +15,7 @@ OPERATION	TOTAL
 chsize	[NUM_BYTES]
 SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
 WHERE THREAD_ID IN
-(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
+(SELECT THREAD_ID FROM performance_schema.THREADS)
 AND EVENT_NAME IN
 (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
 WHERE NAME LIKE "wait/synch/%")
@@ -88,7 +88,7 @@ DROP TRIGGER t_ps_trigger;
 DROP PROCEDURE IF EXISTS t_ps_proc;
 CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
 BEGIN
-SELECT id FROM performance_schema.PROCESSLIST
+SELECT id FROM performance_schema.THREADS
 WHERE THREAD_ID = tid INTO pid;
 END;
 |
@@ -96,7 +96,7 @@ CALL t_ps_proc(0, @p_id);
 DROP FUNCTION IF EXISTS t_ps_proc;
 CREATE FUNCTION t_ps_func(tid INT) RETURNS int
 BEGIN
-return (SELECT id FROM performance_schema.PROCESSLIST
+return (SELECT id FROM performance_schema.THREADS
 WHERE THREAD_ID = tid);
 END;
 |

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_cond_class.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_cond_inst.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_file_class.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_file_class.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_file_inst.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_mutex_class.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_table_hdl.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result	2010-05-17 10:05:47 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_hdl.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_table_inst.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_table_inst.result	2010-05-17 10:05:47 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_table_inst.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_thread_class.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON
@@ -66,7 +65,7 @@ select variable_value > 0 from informati
 where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST';
 variable_value > 0
 1
-select count(*) from performance_schema.PROCESSLIST;
+select count(*) from performance_schema.THREADS;
 count(*)
 0
 show status like "performance_schema_thread_instances_lost";

=== modified file 'mysql-test/suite/perfschema/r/start_server_no_thread_inst.result'
--- a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON
@@ -64,7 +63,7 @@ Performance_schema_thread_classes_lost	0
 show variables like "performance_schema_max_thread_instances";
 Variable_name	Value
 performance_schema_max_thread_instances	0
-select count(*) from performance_schema.PROCESSLIST;
+select count(*) from performance_schema.THREADS;
 count(*)
 0
 select variable_value > 0 from information_schema.global_status

=== modified file 'mysql-test/suite/perfschema/r/start_server_nothing.result'
--- a/mysql-test/suite/perfschema/r/start_server_nothing.result	2010-05-17 10:05:47 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_nothing.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON
@@ -104,12 +103,12 @@ select * from performance_schema.EVENTS_
 THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	OPERATION	NUMBER_OF_BYTES	FLAGS
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
 THREAD_ID	EVENT_ID	EVENT_NAME	SOURCE	TIMER_START	TIMER_END	TIMER_WAIT	SPINS	OBJECT_SCHEMA	OBJECT_NAME	OBJECT_TYPE	OBJECT_INSTANCE_BEGIN	NESTING_EVENT_ID	OPERATION	NUMBER_OF_BYTES	FLAGS
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
-EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 EVENT_NAME	OBJECT_INSTANCE_BEGIN	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
 THREAD_ID	EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+EVENT_NAME	COUNT_STAR	SUM_TIMER_WAIT	MIN_TIMER_WAIT	AVG_TIMER_WAIT	MAX_TIMER_WAIT
 select * from performance_schema.FILE_INSTANCES;
 FILE_NAME	EVENT_NAME	OPEN_COUNT
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
@@ -118,7 +117,7 @@ select * from performance_schema.FILE_SU
 FILE_NAME	EVENT_NAME	COUNT_READ	COUNT_WRITE	SUM_NUMBER_OF_BYTES_READ	SUM_NUMBER_OF_BYTES_WRITE
 select * from performance_schema.MUTEX_INSTANCES;
 NAME	OBJECT_INSTANCE_BEGIN	LOCKED_BY_THREAD_ID
-select * from performance_schema.PROCESSLIST;
+select * from performance_schema.THREADS;
 THREAD_ID	ID	NAME
 select * from performance_schema.RWLOCK_INSTANCES;
 NAME	OBJECT_INSTANCE_BEGIN	WRITE_LOCKED_BY_THREAD_ID	READ_LOCKED_BY_COUNT

=== modified file 'mysql-test/suite/perfschema/r/start_server_off.result'
--- a/mysql-test/suite/perfschema/r/start_server_off.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_off.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	OFF

=== modified file 'mysql-test/suite/perfschema/r/start_server_on.result'
--- a/mysql-test/suite/perfschema/r/start_server_on.result	2010-05-07 12:14:13 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_on.result	2010-08-12 15:25:01 +0000
@@ -21,20 +21,19 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
 select * from performance_schema.PERFORMANCE_TIMERS;
-select * from performance_schema.PROCESSLIST;
 select * from performance_schema.RWLOCK_INSTANCES;
 select * from performance_schema.SETUP_CONSUMERS;
 select * from performance_schema.SETUP_INSTRUMENTS;
-select * from performance_schema.SETUP_OBJECTS;
 select * from performance_schema.SETUP_TIMERS;
+select * from performance_schema.THREADS;
 show variables like "performance_schema%";
 Variable_name	Value
 performance_schema	ON

=== modified file 'mysql-test/suite/perfschema/t/aggregate.test'
--- a/mysql-test/suite/perfschema/t/aggregate.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/aggregate.test	2010-08-12 15:25:01 +0000
@@ -31,7 +31,7 @@ update performance_schema.SETUP_CONSUMER
 # Cleanup statistics
 truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
+truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
 
@@ -66,9 +66,9 @@ set @dump_all=FALSE;
 # because doing so removes a row in FILE_SUMMARY_BY_INSTANCE.
 
 # Likewise:
-# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) >=
+# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) >=
 #   COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_INSTANCE)
-# - MIN(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) <=
+# - MIN(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) <=
 #   MIN(EVENTS_WAITS_SUMMARY_BY_INSTANCE)
 # There will be equality only when an instrument instance
 # is not removed, which is next to impossible to predictably guarantee
@@ -80,9 +80,9 @@ set @dump_all=FALSE;
 # Both cause a row to be deleted from EVENTS_WAITS_SUMMARY_BY_INSTANCE.
 
 # Likewise:
-# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) >=
+# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) >=
 #   COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME)
-# - MIN(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) <=
+# - MIN(EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME) <=
 #   MIN(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME)
 # There will be equality only when no thread is removed,
 # that is if no thread disconnects, or no sub thread (for example insert
@@ -131,14 +131,14 @@ OR @dump_all;
 --echo "Verifying waits aggregate consistency (instance)"
 
 SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
 GROUP BY EVENT_NAME
 HAVING (e.SUM_TIMER_WAIT < SUM(i.SUM_TIMER_WAIT))
 OR @dump_all;
 
 SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
 GROUP BY EVENT_NAME
 HAVING (e.MIN_TIMER_WAIT > MIN(i.MIN_TIMER_WAIT))
@@ -146,7 +146,7 @@ AND (MIN(i.MIN_TIMER_WAIT) != 0)
 OR @dump_all;
 
 SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
 GROUP BY EVENT_NAME
 HAVING (e.MAX_TIMER_WAIT < MAX(i.MAX_TIMER_WAIT))
@@ -155,7 +155,7 @@ OR @dump_all;
 --echo "Verifying waits aggregate consistency (thread)"
 
 SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
 USING (EVENT_NAME)
 GROUP BY EVENT_NAME
@@ -163,7 +163,7 @@ HAVING (e.SUM_TIMER_WAIT < SUM(t.SUM_TIM
 OR @dump_all;
 
 SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
 USING (EVENT_NAME)
 GROUP BY EVENT_NAME
@@ -172,7 +172,7 @@ AND (MIN(t.MIN_TIMER_WAIT) != 0)
 OR @dump_all;
 
 SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT)
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME AS e
 JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
 USING (EVENT_NAME)
 GROUP BY EVENT_NAME

=== removed file 'mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test'
--- a/mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test	1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-# Copyright (c) 2008, 2010, 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-# Tests for PERFORMANCE_SCHEMA
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
--- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME add column foo integer;
-
-truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
-
--- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(EVENT_NAME);
-
--- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME(EVENT_NAME);
-

=== added file 'mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test'
--- a/mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_ews_global_by_event_name.test	2010-08-12 14:08:52 +0000
@@ -0,0 +1,34 @@
+# Copyright (C) 2008-2009 Sun Microsystems, Inc
+#
+# 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  add column foo integer;
+
+truncate table performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  ADD INDEX test_index(EVENT_NAME);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index
+  ON performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME(EVENT_NAME);
+

=== removed file 'mysql-test/suite/perfschema/t/ddl_processlist.test'
--- a/mysql-test/suite/perfschema/t/ddl_processlist.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_processlist.test	1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
-# Copyright (c) 2008, 2010, 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-# Tests for PERFORMANCE_SCHEMA
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
--- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.PROCESSLIST add column foo integer;
-
--- error ER_WRONG_PERFSCHEMA_USAGE
-truncate table performance_schema.PROCESSLIST;
-
--- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.PROCESSLIST ADD INDEX test_index(ID);
-
--- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.PROCESSLIST(ID);
-

=== removed file 'mysql-test/suite/perfschema/t/ddl_setup_objects.test'
--- a/mysql-test/suite/perfschema/t/ddl_setup_objects.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_setup_objects.test	1970-01-01 00:00:00 +0000
@@ -1,32 +0,0 @@
-# Copyright (c) 2009, 2010, 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-# Tests for PERFORMANCE_SCHEMA
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
---replace_result '\'setup_objects' '\'SETUP_OBJECTS'
--- error ER_DBACCESS_DENIED_ERROR
-alter table performance_schema.SETUP_OBJECTS add column foo integer;
-
-truncate table performance_schema.SETUP_OBJECTS;
-
--- error ER_DBACCESS_DENIED_ERROR
-ALTER TABLE performance_schema.SETUP_OBJECTS ADD INDEX test_index(OBJECT_NAME);
-
--- error ER_DBACCESS_DENIED_ERROR
-CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_OBJECTS(OBJECT_NAME);
-

=== added file 'mysql-test/suite/perfschema/t/ddl_threads.test'
--- a/mysql-test/suite/perfschema/t/ddl_threads.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_threads.test	2010-08-12 14:08:52 +0000
@@ -0,0 +1,32 @@
+# Copyright (C) 2008-2009 Sun Microsystems, Inc
+#
+# 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.THREADS add column foo integer;
+
+-- error ER_WRONG_PERFSCHEMA_USAGE
+truncate table performance_schema.THREADS;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.THREADS ADD INDEX test_index(ID);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.THREADS(ID);
+

=== removed file 'mysql-test/suite/perfschema/t/dml_ews_by_event_name.test'
--- a/mysql-test/suite/perfschema/t/dml_ews_by_event_name.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/dml_ews_by_event_name.test	1970-01-01 00:00:00 +0000
@@ -1,62 +0,0 @@
-# Copyright (c) 2009, 2010, 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-# Tests for PERFORMANCE_SCHEMA
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
---replace_column 1 # 2 # 3 # 4 # 5 # 6 #
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-  where event_name like 'Wait/Synch/%' limit 1;
-
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-  where event_name='FOO';
-
---replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
---error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-  set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
-  avg_timer_wait=4, max_timer_wait=5;
-
---replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
---error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-  set count_star=12;
-
---replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
---error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-  set count_star=12 where event_name like "FOO";
-
---replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
---error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
-  where count_star=1;
-
---replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
---error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
-
---replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
--- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME READ;
-UNLOCK TABLES;
-
---replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME'
--- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME WRITE;
-UNLOCK TABLES;
-

=== added file 'mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test'
--- a/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/dml_ews_global_by_event_name.test	2010-08-12 14:08:52 +0000
@@ -0,0 +1,62 @@
+# Copyright (C) 2009 Sun Microsystems, Inc
+#
+# 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--replace_column 1 # 2 # 3 # 4 # 5 # 6 #
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  where event_name like 'Wait/Synch/%' limit 1;
+
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  where event_name='FOO';
+
+--replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3,
+  avg_timer_wait=4, max_timer_wait=5;
+
+--replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  set count_star=12;
+
+--replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  set count_star=12 where event_name like "FOO";
+
+--replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
+  where count_star=1;
+
+--replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
+
+--replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME READ;
+UNLOCK TABLES;
+
+--replace_result '\'events_waits_summary_global_by_event_name' '\'EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME'
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME WRITE;
+UNLOCK TABLES;
+

=== removed file 'mysql-test/suite/perfschema/t/dml_processlist.test'
--- a/mysql-test/suite/perfschema/t/dml_processlist.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/dml_processlist.test	1970-01-01 00:00:00 +0000
@@ -1,61 +0,0 @@
-# Copyright (c) 2009, 2010, 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-# Tests for PERFORMANCE_SCHEMA
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
---replace_column 1 # 2 # 3 #
-select * from performance_schema.PROCESSLIST
-  where name like 'Thread/%' limit 1;
-
-select * from performance_schema.PROCESSLIST
-  where name='FOO';
-
---replace_result '\'processlist' '\'PROCESSLIST'
---error ER_TABLEACCESS_DENIED_ERROR
-insert into performance_schema.PROCESSLIST
-  set name='FOO', thread_id=1, id=2;
-
---replace_result '\'processlist' '\'PROCESSLIST'
---error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.PROCESSLIST
-  set thread_id=12;
-
---replace_result '\'processlist' '\'PROCESSLIST'
---error ER_TABLEACCESS_DENIED_ERROR
-update performance_schema.PROCESSLIST
-  set thread_id=12 where name like "FOO";
-
---replace_result '\'processlist' '\'PROCESSLIST'
---error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.PROCESSLIST
-  where id=1;
-
---replace_result '\'processlist' '\'PROCESSLIST'
---error ER_TABLEACCESS_DENIED_ERROR
-delete from performance_schema.PROCESSLIST;
-
---replace_result '\'processlist' '\'PROCESSLIST'
--- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.PROCESSLIST READ;
-UNLOCK TABLES;
-
---replace_result '\'processlist' '\'PROCESSLIST'
--- error ER_TABLEACCESS_DENIED_ERROR
-LOCK TABLES performance_schema.PROCESSLIST WRITE;
-UNLOCK TABLES;
-

=== removed file 'mysql-test/suite/perfschema/t/dml_setup_objects.test'
--- a/mysql-test/suite/perfschema/t/dml_setup_objects.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/dml_setup_objects.test	1970-01-01 00:00:00 +0000
@@ -1,75 +0,0 @@
-# Copyright (c) 2009, 2010, 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
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
-
-# Tests for PERFORMANCE_SCHEMA
-
---source include/not_embedded.inc
---source include/have_perfschema.inc
-
-select * from performance_schema.SETUP_OBJECTS;
-
-select * from performance_schema.SETUP_OBJECTS
-  where object_type = 'TABLE';
-
-select * from performance_schema.SETUP_OBJECTS
-  where enabled='YES';
-
-# Not implemented yet
---replace_result '\'setup_objects' '\'SETUP_OBJECTS'
---error ER_ILLEGAL_HA
-insert into performance_schema.SETUP_OBJECTS
-  set object_type='TABLE', object_schema='FOO', object_name='BAR',
-  enabled='YES', timed='YES', aggregated='YES';
-
-# Not implemented yet
-# --error ER_ILLEGAL_HA
-update performance_schema.SETUP_OBJECTS
-  set object_type='TABLE';
-
-# Not implemented yet
-# --error ER_ILLEGAL_HA
-update performance_schema.SETUP_OBJECTS
-  set object_schema='ILLEGAL';
-
-# Not implemented yet
-# --error ER_ILLEGAL_HA
-update performance_schema.SETUP_OBJECTS
-  set object_name='ILLEGAL';
-
-update performance_schema.SETUP_OBJECTS
-  set enabled='NO';
-
-update performance_schema.SETUP_OBJECTS
-  set timed='NO';
-
-update performance_schema.SETUP_OBJECTS
-  set aggregated='NO';
-
-select * from performance_schema.SETUP_OBJECTS;
-
-update performance_schema.SETUP_OBJECTS
-  set enabled='YES', timed='YES', aggregated='YES';
-
-delete from performance_schema.SETUP_OBJECTS
-  where object_type = 'TABLE';
-
-delete from performance_schema.SETUP_OBJECTS;
-
-LOCK TABLES performance_schema.SETUP_OBJECTS READ;
-UNLOCK TABLES;
-
-LOCK TABLES performance_schema.SETUP_OBJECTS WRITE;
-UNLOCK TABLES;
-

=== added file 'mysql-test/suite/perfschema/t/dml_threads.test'
--- a/mysql-test/suite/perfschema/t/dml_threads.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/dml_threads.test	2010-08-12 14:08:52 +0000
@@ -0,0 +1,61 @@
+# Copyright (C) 2009 Sun Microsystems, Inc
+#
+# 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+--source include/not_embedded.inc
+--source include/have_perfschema.inc
+
+--replace_column 1 # 2 # 3 #
+select * from performance_schema.THREADS
+  where name like 'Thread/%' limit 1;
+
+select * from performance_schema.THREADS
+  where name='FOO';
+
+--replace_result '\'threads' '\'THREADS'
+--error ER_TABLEACCESS_DENIED_ERROR
+insert into performance_schema.THREADS
+  set name='FOO', thread_id=1, id=2;
+
+--replace_result '\'threads' '\'THREADS'
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.THREADS
+  set thread_id=12;
+
+--replace_result '\'threads' '\'THREADS'
+--error ER_TABLEACCESS_DENIED_ERROR
+update performance_schema.THREADS
+  set thread_id=12 where name like "FOO";
+
+--replace_result '\'threads' '\'THREADS'
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.THREADS
+  where id=1;
+
+--replace_result '\'threads' '\'THREADS'
+--error ER_TABLEACCESS_DENIED_ERROR
+delete from performance_schema.THREADS;
+
+--replace_result '\'threads' '\'THREADS'
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.THREADS READ;
+UNLOCK TABLES;
+
+--replace_result '\'threads' '\'THREADS'
+-- error ER_TABLEACCESS_DENIED_ERROR
+LOCK TABLES performance_schema.THREADS WRITE;
+UNLOCK TABLES;
+

=== modified file 'mysql-test/suite/perfschema/t/func_file_io.test'
--- a/mysql-test/suite/perfschema/t/func_file_io.test	2010-06-15 14:46:02 +0000
+++ b/mysql-test/suite/perfschema/t/func_file_io.test	2010-08-12 15:25:01 +0000
@@ -144,7 +144,7 @@ WHERE FILE_NAME LIKE CONCAT('%', @@tmpdi
 #
 --disable_result_log
 SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT
-FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
+FROM performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
 WHERE COUNT_STAR > 0
 ORDER BY SUM_TIMER_WAIT DESC
 LIMIT 10;
@@ -158,7 +158,7 @@ LIMIT 10;
 SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT
 # ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE
 FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
+INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
 LEFT JOIN information_schema.PROCESSLIST i USING (ID)
 GROUP BY i.user
 ORDER BY SUM_WAIT DESC
@@ -171,7 +171,7 @@ LIMIT 20;
 --disable_result_log
 SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT
 FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
+INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
 WHERE p.ID = 1
 GROUP BY h.EVENT_NAME
 HAVING TOTAL_WAIT > 0;
@@ -184,7 +184,7 @@ HAVING TOTAL_WAIT > 0;
 --disable_result_log
 SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes
 FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h
-INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID)
+INNER JOIN performance_schema.THREADS p USING (THREAD_ID)
 LEFT JOIN information_schema.PROCESSLIST i USING (ID)
 GROUP BY i.user, h.operation
 HAVING BYTES > 0

=== modified file 'mysql-test/suite/perfschema/t/misc.test'
--- a/mysql-test/suite/perfschema/t/misc.test	2010-07-16 01:28:30 +0000
+++ b/mysql-test/suite/perfschema/t/misc.test	2010-08-12 15:25:01 +0000
@@ -27,7 +27,7 @@
 --disable_result_log
 SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
 WHERE THREAD_ID IN
-  (SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
+  (SELECT THREAD_ID FROM performance_schema.THREADS)
 AND EVENT_NAME IN
   (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
    WHERE NAME LIKE "wait/synch/%")

=== modified file 'mysql-test/suite/perfschema/t/no_threads.test'
--- a/mysql-test/suite/perfschema/t/no_threads.test	2010-06-15 14:46:02 +0000
+++ b/mysql-test/suite/perfschema/t/no_threads.test	2010-08-12 15:25:01 +0000
@@ -45,10 +45,10 @@ show variables like "performance_schema_
 
 # Verification : in this main thread
 
-select count(*) from performance_schema.PROCESSLIST
+select count(*) from performance_schema.THREADS
   where name like "thread/sql/main";
 
-select count(*) from performance_schema.PROCESSLIST
+select count(*) from performance_schema.THREADS
   where name like "thread/sql/OneConnection";
 
 select event_name, operation,

=== modified file 'mysql-test/suite/perfschema/t/schema.test'
--- a/mysql-test/suite/perfschema/t/schema.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/schema.test	2010-08-12 15:25:01 +0000
@@ -29,18 +29,17 @@ show create table COND_INSTANCES;
 show create table EVENTS_WAITS_CURRENT;
 show create table EVENTS_WAITS_HISTORY;
 show create table EVENTS_WAITS_HISTORY_LONG;
-show create table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+show create table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 show create table FILE_INSTANCES;
 show create table FILE_SUMMARY_BY_EVENT_NAME;
 show create table FILE_SUMMARY_BY_INSTANCE;
 show create table MUTEX_INSTANCES;
 show create table PERFORMANCE_TIMERS;
-show create table PROCESSLIST;
 show create table RWLOCK_INSTANCES;
 show create table SETUP_CONSUMERS;
 show create table SETUP_INSTRUMENTS;
-show create table SETUP_OBJECTS;
 show create table SETUP_TIMERS;
+show create table THREADS;
 

=== modified file 'mysql-test/suite/perfschema/t/selects.test'
--- a/mysql-test/suite/perfschema/t/selects.test	2010-07-29 13:37:49 +0000
+++ b/mysql-test/suite/perfschema/t/selects.test	2010-08-12 15:25:01 +0000
@@ -51,7 +51,7 @@ LIMIT 1;
 --replace_column 1 [EVENT_ID]
 SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
 WHERE THREAD_ID IN
-  (SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
+  (SELECT THREAD_ID FROM performance_schema.THREADS)
 AND EVENT_NAME IN
   (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
    WHERE NAME LIKE "wait/synch/%")
@@ -144,7 +144,7 @@ delimiter |;
 
 CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
 BEGIN
-   SELECT id FROM performance_schema.PROCESSLIST
+   SELECT id FROM performance_schema.THREADS
    WHERE THREAD_ID = tid INTO pid;
 END;
 
@@ -163,7 +163,7 @@ delimiter |;
 
 CREATE FUNCTION t_ps_func(tid INT) RETURNS int
 BEGIN
-   return (SELECT id FROM performance_schema.PROCESSLIST
+   return (SELECT id FROM performance_schema.THREADS
            WHERE THREAD_ID = tid);
 END;
 

=== modified file 'mysql-test/suite/perfschema/t/start_server_no_thread_class.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_thread_class.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_thread_class.test	2010-08-12 15:25:01 +0000
@@ -31,7 +31,7 @@ select variable_value > 0 from informati
   where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST';
 
 # Expect no instances
-select count(*) from performance_schema.PROCESSLIST;
+select count(*) from performance_schema.THREADS;
 
 # Expect no instances lost
 show status like "performance_schema_thread_instances_lost";

=== modified file 'mysql-test/suite/perfschema/t/start_server_no_thread_inst.test'
--- a/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test	2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test	2010-08-12 15:25:01 +0000
@@ -33,7 +33,7 @@ show status like "performance_schema_thr
 # Expect no instances
 show variables like "performance_schema_max_thread_instances";
 
-select count(*) from performance_schema.PROCESSLIST;
+select count(*) from performance_schema.THREADS;
 
 # Expect instances lost
 select variable_value > 0 from information_schema.global_status

=== modified file 'mysql-test/suite/perfschema/t/start_server_nothing.test'
--- a/mysql-test/suite/perfschema/t/start_server_nothing.test	2010-07-02 17:25:26 +0000
+++ b/mysql-test/suite/perfschema/t/start_server_nothing.test	2010-08-12 15:25:01 +0000
@@ -33,13 +33,13 @@ select * from performance_schema.COND_IN
 select * from performance_schema.EVENTS_WAITS_CURRENT;
 select * from performance_schema.EVENTS_WAITS_HISTORY;
 select * from performance_schema.EVENTS_WAITS_HISTORY_LONG;
-select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
 select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
+select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME;
 select * from performance_schema.FILE_INSTANCES;
 select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
 select * from performance_schema.FILE_SUMMARY_BY_INSTANCE;
 select * from performance_schema.MUTEX_INSTANCES;
-select * from performance_schema.PROCESSLIST;
+select * from performance_schema.THREADS;
 select * from performance_schema.RWLOCK_INSTANCES;
 

=== modified file 'mysql-test/suite/perfschema/t/thread_cache.test'
--- a/mysql-test/suite/perfschema/t/thread_cache.test	2010-06-25 07:56:10 +0000
+++ b/mysql-test/suite/perfschema/t/thread_cache.test	2010-08-12 15:25:01 +0000
@@ -30,14 +30,14 @@ connect (con1, localhost, root, , );
 
 let $con1_ID=`select connection_id()`;
 
-let $con1_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID = connection_id()`;
 
 connect (con2, localhost, root, , );
 
 let $con2_ID=`select connection_id()`;
 
-let $con2_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID = connection_id()`;
 
 connection default;
@@ -58,7 +58,7 @@ connect (con3, localhost, root, , );
 
 let $con3_ID=`select connection_id()`;
 
-let $con3_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID = connection_id()`;
 
 disconnect con3;
@@ -82,14 +82,14 @@ connect (con1, localhost, root, , );
 
 let $con1_ID=`select connection_id()`;
 
-let $con1_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID = connection_id()`;
 
 connect (con2, localhost, root, , );
 
 let $con2_ID=`select connection_id()`;
 
-let $con2_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID = connection_id()`;
 
 connection default;
@@ -108,7 +108,7 @@ connect (con3, localhost, root, , );
 
 let $con3_ID=`select connection_id()`;
 
-let $con3_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST
+let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS
   where ID = connection_id()`;
 
 disconnect con3;

=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql	2010-06-30 14:05:18 +0000
+++ b/scripts/mysql_system_tables.sql	2010-08-12 15:25:01 +0000
@@ -264,11 +264,12 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 --
--- TABLE EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
+-- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE
 --
 
-SET @cmd="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME("
+SET @cmd="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE("
   "EVENT_NAME VARCHAR(128) not null,"
+  "OBJECT_INSTANCE_BEGIN BIGINT not null,"
   "COUNT_STAR BIGINT unsigned not null,"
   "SUM_TIMER_WAIT BIGINT unsigned not null,"
   "MIN_TIMER_WAIT BIGINT unsigned not null,"
@@ -282,12 +283,12 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 --
--- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE
+-- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
 --
 
-SET @cmd="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE("
+SET @cmd="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME("
+  "THREAD_ID INTEGER not null,"
   "EVENT_NAME VARCHAR(128) not null,"
-  "OBJECT_INSTANCE_BEGIN BIGINT not null,"
   "COUNT_STAR BIGINT unsigned not null,"
   "SUM_TIMER_WAIT BIGINT unsigned not null,"
   "MIN_TIMER_WAIT BIGINT unsigned not null,"
@@ -301,11 +302,10 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 --
--- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
+-- TABLE EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME
 --
 
-SET @cmd="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME("
-  "THREAD_ID INTEGER not null,"
+SET @cmd="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME("
   "EVENT_NAME VARCHAR(128) not null,"
   "COUNT_STAR BIGINT unsigned not null,"
   "SUM_TIMER_WAIT BIGINT unsigned not null,"
@@ -401,21 +401,6 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 --
--- TABLE PROCESSLIST
---
-
-SET @cmd="CREATE TABLE performance_schema.PROCESSLIST("
-  "THREAD_ID INTEGER not null,"
-  "ID INTEGER not null,"
-  "NAME VARCHAR(64) not null"
-  ")ENGINE=PERFORMANCE_SCHEMA;";
-
-SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
-PREPARE stmt FROM @str;
-EXECUTE stmt;
-DROP PREPARE stmt;
-
---
 -- TABLE RWLOCK_INSTANCES
 --
 
@@ -446,16 +431,13 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 --
--- TABLE SETUP_OBJECTS
+-- TABLE SETUP_INSTRUMENTS
 --
 
-SET @cmd="CREATE TABLE performance_schema.SETUP_OBJECTS("
-  "OBJECT_TYPE VARCHAR(64),"
-  "OBJECT_SCHEMA VARCHAR(64),"
-  "OBJECT_NAME VARCHAR(64),"
+SET @cmd="CREATE TABLE performance_schema.SETUP_INSTRUMENTS("
+  "NAME VARCHAR(128) not null,"
   "ENABLED ENUM ('YES', 'NO') not null,"
-  "TIMED ENUM ('YES', 'NO') not null,"
-  "AGGREGATED ENUM ('YES', 'NO') not null"
+  "TIMED ENUM ('YES', 'NO') not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
@@ -464,13 +446,12 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 --
--- TABLE SETUP_INSTRUMENTS
+-- TABLE SETUP_TIMERS
 --
 
-SET @cmd="CREATE TABLE performance_schema.SETUP_INSTRUMENTS("
-  "NAME VARCHAR(128) not null,"
-  "ENABLED ENUM ('YES', 'NO') not null,"
-  "TIMED ENUM ('YES', 'NO') not null"
+SET @cmd="CREATE TABLE performance_schema.SETUP_TIMERS("
+  "NAME VARCHAR(64) not null,"
+  "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
@@ -479,12 +460,13 @@ EXECUTE stmt;
 DROP PREPARE stmt;
 
 --
--- TABLE SETUP_TIMERS
+-- TABLE THREADS
 --
 
-SET @cmd="CREATE TABLE performance_schema.SETUP_TIMERS("
-  "NAME VARCHAR(64) not null,"
-  "TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"
+SET @cmd="CREATE TABLE performance_schema.THREADS("
+  "THREAD_ID INTEGER not null,"
+  "ID INTEGER not null,"
+  "NAME VARCHAR(64) not null"
   ")ENGINE=PERFORMANCE_SCHEMA;";
 
 SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');

=== modified file 'storage/perfschema/CMakeLists.txt'
--- a/storage/perfschema/CMakeLists.txt	2010-07-23 17:08:41 +0000
+++ b/storage/perfschema/CMakeLists.txt	2010-08-12 15:25:01 +0000
@@ -38,16 +38,16 @@ SET(PERFSCHEMA_SOURCES ha_perfschema.h
   table_all_instr.h
   table_events_waits.h
   table_events_waits_summary.h
+  table_ews_global_by_event_name.h
   table_file_instances.h
   table_file_summary.h
   table_helper.h
   table_performance_timers.h
-  table_processlist.h
   table_setup_consumers.h
   table_setup_instruments.h
-  table_setup_objects.h
   table_setup_timers.h
   table_sync_instances.h
+  table_threads.h
   ha_perfschema.cc
   pfs.cc
   pfs_column_values.cc
@@ -61,15 +61,15 @@ SET(PERFSCHEMA_SOURCES ha_perfschema.h
   table_all_instr.cc
   table_events_waits.cc
   table_events_waits_summary.cc
+  table_ews_global_by_event_name.cc
   table_file_instances.cc
   table_file_summary.cc
   table_performance_timers.cc
-  table_processlist.cc
   table_setup_consumers.cc
   table_setup_instruments.cc
-  table_setup_objects.cc
   table_setup_timers.cc
   table_sync_instances.cc
+  table_threads.cc
   pfs_atomic.cc
   pfs_check.cc
 )

=== modified file 'storage/perfschema/Makefile.am'
--- a/storage/perfschema/Makefile.am	2010-07-23 17:08:41 +0000
+++ b/storage/perfschema/Makefile.am	2010-08-12 15:25:01 +0000
@@ -39,12 +39,12 @@ noinst_HEADERS = ha_perfschema.h pfs_eng
                 table_setup_instruments.h table_performance_timers.h \
                 table_setup_timers.h table_helper.h \
                 table_setup_consumers.h table_events_waits.h \
-		pfs_events_waits.h pfs_timer.h table_processlist.h \
+		pfs_events_waits.h pfs_timer.h table_threads.h \
 		table_sync_instances.h \
 		table_events_waits_summary.h pfs_stat.h \
-		table_all_instr.h \
+		table_ews_global_by_event_name.h table_all_instr.h \
 		table_file_instances.h table_file_summary.h \
-		table_setup_objects.h pfs_lock.h pfs_atomic.h
+		pfs_lock.h pfs_atomic.h
 
 PSE_SOURCES = ha_perfschema.cc pfs_engine_table.cc pfs.cc pfs_server.cc \
 		pfs_global.cc pfs_instr_class.cc pfs_instr.cc \
@@ -52,12 +52,12 @@ PSE_SOURCES = ha_perfschema.cc pfs_engin
                 table_setup_instruments.cc table_performance_timers.cc \
                 table_setup_timers.cc \
                 table_setup_consumers.cc table_events_waits.cc \
-		pfs_events_waits.cc pfs_timer.cc table_processlist.cc \
+		pfs_events_waits.cc pfs_timer.cc table_threads.cc \
 		table_sync_instances.cc \
 		table_events_waits_summary.cc \
-		table_all_instr.cc \
+		table_ews_global_by_event_name.cc table_all_instr.cc \
 		table_file_instances.cc table_file_summary.cc \
-		table_setup_objects.cc pfs_atomic.cc pfs_check.cc
+		pfs_atomic.cc pfs_check.cc
 
 EXTRA_LIBRARIES = libperfschema.a
 noinst_LIBRARIES = @plugin_perfschema_static_target@

=== modified file 'storage/perfschema/pfs_engine_table.cc'
--- a/storage/perfschema/pfs_engine_table.cc	2010-07-16 01:28:30 +0000
+++ b/storage/perfschema/pfs_engine_table.cc	2010-08-12 15:25:01 +0000
@@ -23,11 +23,11 @@
 #include "table_events_waits.h"
 #include "table_setup_consumers.h"
 #include "table_setup_instruments.h"
-#include "table_setup_objects.h"
 #include "table_setup_timers.h"
 #include "table_performance_timers.h"
-#include "table_processlist.h"
+#include "table_threads.h"
 #include "table_events_waits_summary.h"
+#include "table_ews_global_by_event_name.h"
 #include "table_sync_instances.h"
 #include "table_file_instances.h"
 #include "table_file_summary.h"
@@ -52,13 +52,12 @@ static PFS_engine_table_share *all_share
   &table_events_waits_history_long::m_share,
   &table_setup_consumers::m_share,
   &table_setup_instruments::m_share,
-  &table_setup_objects::m_share,
   &table_setup_timers::m_share,
   &table_performance_timers::m_share,
-  &table_processlist::m_share,
+  &table_threads::m_share,
   &table_events_waits_summary_by_thread_by_event_name::m_share,
-  &table_events_waits_summary_by_event_name::m_share,
   &table_events_waits_summary_by_instance::m_share,
+  &table_ews_global_by_event_name::m_share,
   &table_file_summary_by_event_name::m_share,
   &table_file_summary_by_instance::m_share,
   &table_mutex_instances::m_share,

=== modified file 'storage/perfschema/table_events_waits_summary.cc'
--- a/storage/perfschema/table_events_waits_summary.cc	2010-07-16 01:28:30 +0000
+++ b/storage/perfschema/table_events_waits_summary.cc	2010-08-12 15:25:01 +0000
@@ -338,144 +338,6 @@ int table_events_waits_summary_by_thread
   return 0;
 }
 
-THR_LOCK table_events_waits_summary_by_event_name::m_table_lock;
-
-static const TABLE_FIELD_TYPE ews_by_event_name_field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("EVENT_NAME") },
-    { C_STRING_WITH_LEN("varchar(128)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("COUNT_STAR") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
-    { C_STRING_WITH_LEN("bigint(20)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_events_waits_summary_by_event_name::m_field_def=
-{ 6, ews_by_event_name_field_types };
-
-PFS_engine_table_share
-table_events_waits_summary_by_event_name::m_share=
-{
-  { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_BY_EVENT_NAME") },
-  &pfs_truncatable_acl,
-  &table_events_waits_summary_by_event_name::create,
-  NULL, /* write_row */
-  &table_events_waits_summary_by_event_name::delete_all_rows,
-  1000, /* records */
-  sizeof(pos_all_instr_class),
-  &m_table_lock,
-  &m_field_def,
-  false /* checked */
-};
-
-PFS_engine_table* table_events_waits_summary_by_event_name::create(void)
-{
-  return new table_events_waits_summary_by_event_name();
-}
-
-int table_events_waits_summary_by_event_name::delete_all_rows(void)
-{
-  reset_instrument_class_waits();
-  return 0;
-}
-
-table_events_waits_summary_by_event_name
-::table_events_waits_summary_by_event_name()
-  : table_all_instr_class(&m_share)
-{}
-
-void table_events_waits_summary_by_event_name
-::make_instr_row(PFS_instr_class *klass)
-{
-  m_row.m_name= klass->m_name;
-  m_row.m_name_length= klass->m_name_length;
-
-  m_row.m_count= klass->m_wait_stat.m_count;
-  m_row.m_sum= klass->m_wait_stat.m_sum;
-  m_row.m_min= klass->m_wait_stat.m_min;
-  m_row.m_max= klass->m_wait_stat.m_max;
-
-  if (m_row.m_count)
-    m_row.m_avg= m_row.m_sum / m_row.m_count;
-  else
-  {
-    m_row.m_min= 0;
-    m_row.m_avg= 0;
-  }
-}
-
-int table_events_waits_summary_by_event_name
-::read_row_values(TABLE *table, unsigned char *, Field **fields,
-                  bool read_all)
-{
-  Field *f;
-
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
-
-  /*
-    The row always exist,
-    the instrument classes are static and never disappear.
-  */
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (read_all || bitmap_is_set(table->read_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* NAME */
-        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
-        break;
-      case 1: /* COUNT */
-        set_field_ulonglong(f, m_row.m_count);
-        break;
-      case 2: /* SUM */
-        set_field_ulonglong(f, m_row.m_sum);
-        break;
-      case 3: /* MIN */
-        set_field_ulonglong(f, m_row.m_min);
-        break;
-      case 4: /* AVG */
-        set_field_ulonglong(f, m_row.m_avg);
-        break;
-      case 5: /* MAX */
-        set_field_ulonglong(f, m_row.m_max);
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-
-  return 0;
-}
-
 THR_LOCK table_events_waits_summary_by_instance::m_table_lock;
 
 static const TABLE_FIELD_TYPE ews_by_instance_field_types[]=

=== modified file 'storage/perfschema/table_events_waits_summary.h'
--- a/storage/perfschema/table_events_waits_summary.h	2010-07-23 17:08:41 +0000
+++ b/storage/perfschema/table_events_waits_summary.h	2010-08-12 15:25:01 +0000
@@ -145,58 +145,6 @@ private:
   pos_events_waits_summary_by_thread_by_event_name m_next_pos;
 };
 
-/** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME. */
-struct row_events_waits_summary_by_event_name
-{
-  /** Column EVENT_NAME. */
-  const char *m_name;
-  /** Length in bytes of @c m_name. */
-  uint m_name_length;
-  /** Column COUNT_STAR. */
-  ulonglong m_count;
-  /** Column SUM_TIMER_WAIT. */
-  ulonglong m_sum;
-  /** Column MIN_TIMER_WAIT. */
-  ulonglong m_min;
-  /** Column AVG_TIMER_WAIT. */
-  ulonglong m_avg;
-  /** Column MAX_TIMER_WAIT. */
-  ulonglong m_max;
-};
-
-/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME. */
-class table_events_waits_summary_by_event_name : public table_all_instr_class
-{
-public:
-  /** Table share */
-  static PFS_engine_table_share m_share;
-  static PFS_engine_table* create();
-  static int delete_all_rows();
-
-protected:
-  virtual void make_instr_row(PFS_instr_class *klass);
-
-  virtual int read_row_values(TABLE *table,
-                              unsigned char *buf,
-                              Field **fields,
-                              bool read_all);
-
-  table_events_waits_summary_by_event_name();
-
-public:
-  ~table_events_waits_summary_by_event_name()
-  {}
-
-private:
-  /** Table share lock. */
-  static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
-
-  /** Current row. */
-  row_events_waits_summary_by_event_name m_row;
-};
-
 /** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE. */
 struct row_events_waits_summary_by_instance
 {

=== added file 'storage/perfschema/table_ews_global_by_event_name.cc'
--- a/storage/perfschema/table_ews_global_by_event_name.cc	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_ews_global_by_event_name.cc	2010-08-12 14:08:52 +0000
@@ -0,0 +1,166 @@
+/* Copyright (c) 2008, 2010, 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
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software Foundation,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+/**
+  @file storage/perfschema/table_ews_global_by_event_name.cc
+  Table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME (implementation).
+*/
+
+#include "my_global.h"
+#include "my_pthread.h"
+#include "pfs_instr_class.h"
+#include "pfs_column_types.h"
+#include "pfs_column_values.h"
+#include "table_ews_global_by_event_name.h"
+#include "pfs_global.h"
+
+THR_LOCK table_ews_global_by_event_name::m_table_lock;
+
+static const TABLE_FIELD_TYPE field_types[]=
+{
+  {
+    { C_STRING_WITH_LEN("EVENT_NAME") },
+    { C_STRING_WITH_LEN("varchar(128)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("COUNT_STAR") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("SUM_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MIN_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("AVG_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("MAX_TIMER_WAIT") },
+    { C_STRING_WITH_LEN("bigint(20)") },
+    { NULL, 0}
+  }
+};
+
+TABLE_FIELD_DEF
+table_ews_global_by_event_name::m_field_def=
+{ 6, field_types };
+
+PFS_engine_table_share
+table_ews_global_by_event_name::m_share=
+{
+  { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME") },
+  &pfs_truncatable_acl,
+  &table_ews_global_by_event_name::create,
+  NULL, /* write_row */
+  &table_ews_global_by_event_name::delete_all_rows,
+  1000, /* records */
+  sizeof(pos_all_instr_class),
+  &m_table_lock,
+  &m_field_def,
+  false /* checked */
+};
+
+PFS_engine_table* table_ews_global_by_event_name::create(void)
+{
+  return new table_ews_global_by_event_name();
+}
+
+int table_ews_global_by_event_name::delete_all_rows(void)
+{
+  reset_instrument_class_waits();
+  return 0;
+}
+
+table_ews_global_by_event_name
+::table_ews_global_by_event_name()
+  : table_all_instr_class(&m_share)
+{}
+
+void table_ews_global_by_event_name
+::make_instr_row(PFS_instr_class *klass)
+{
+  m_row.m_name= klass->m_name;
+  m_row.m_name_length= klass->m_name_length;
+
+  m_row.m_count= klass->m_wait_stat.m_count;
+  m_row.m_sum= klass->m_wait_stat.m_sum;
+  m_row.m_min= klass->m_wait_stat.m_min;
+  m_row.m_max= klass->m_wait_stat.m_max;
+
+  if (m_row.m_count)
+    m_row.m_avg= m_row.m_sum / m_row.m_count;
+  else
+  {
+    m_row.m_min= 0;
+    m_row.m_avg= 0;
+  }
+}
+
+int table_ews_global_by_event_name
+::read_row_values(TABLE *table, unsigned char *, Field **fields,
+                  bool read_all)
+{
+  Field *f;
+
+  /* Set the null bits */
+  DBUG_ASSERT(table->s->null_bytes == 0);
+
+  /*
+    The row always exist,
+    the instrument classes are static and never disappear.
+  */
+
+  for (; (f= *fields) ; fields++)
+  {
+    if (read_all || bitmap_is_set(table->read_set, f->field_index))
+    {
+      switch(f->field_index)
+      {
+      case 0: /* NAME */
+        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
+        break;
+      case 1: /* COUNT */
+        set_field_ulonglong(f, m_row.m_count);
+        break;
+      case 2: /* SUM */
+        set_field_ulonglong(f, m_row.m_sum);
+        break;
+      case 3: /* MIN */
+        set_field_ulonglong(f, m_row.m_min);
+        break;
+      case 4: /* AVG */
+        set_field_ulonglong(f, m_row.m_avg);
+        break;
+      case 5: /* MAX */
+        set_field_ulonglong(f, m_row.m_max);
+        break;
+      default:
+        DBUG_ASSERT(false);
+      }
+    }
+  }
+
+  return 0;
+}
+

=== added file 'storage/perfschema/table_ews_global_by_event_name.h'
--- a/storage/perfschema/table_ews_global_by_event_name.h	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_ews_global_by_event_name.h	2010-08-12 14:08:52 +0000
@@ -0,0 +1,88 @@
+/* Copyright (c) 2008, 2010, 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
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software Foundation,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef TABLE_EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME_H
+#define TABLE_EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME_H
+
+/**
+  @file storage/perfschema/table_ews_global_by_event_name.h
+  Table EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME (declarations).
+*/
+
+#include "pfs_column_types.h"
+#include "pfs_engine_table.h"
+#include "pfs_instr_class.h"
+#include "pfs_instr.h"
+#include "table_all_instr.h"
+
+/**
+  @addtogroup Performance_schema_tables
+  @{
+*/
+
+/** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME. */
+struct row_ews_global_by_event_name
+{
+  /** Column EVENT_NAME. */
+  const char *m_name;
+  /** Length in bytes of @c m_name. */
+  uint m_name_length;
+  /** Column COUNT_STAR. */
+  ulonglong m_count;
+  /** Column SUM_TIMER_WAIT. */
+  ulonglong m_sum;
+  /** Column MIN_TIMER_WAIT. */
+  ulonglong m_min;
+  /** Column AVG_TIMER_WAIT. */
+  ulonglong m_avg;
+  /** Column MAX_TIMER_WAIT. */
+  ulonglong m_max;
+};
+
+/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME. */
+class table_ews_global_by_event_name : public table_all_instr_class
+{
+public:
+  /** Table share */
+  static PFS_engine_table_share m_share;
+  static PFS_engine_table* create();
+  static int delete_all_rows();
+
+protected:
+  virtual void make_instr_row(PFS_instr_class *klass);
+
+  virtual int read_row_values(TABLE *table,
+                              unsigned char *buf,
+                              Field **fields,
+                              bool read_all);
+
+  table_ews_global_by_event_name();
+
+public:
+  ~table_ews_global_by_event_name()
+  {}
+
+private:
+  /** Table share lock. */
+  static THR_LOCK m_table_lock;
+  /** Fields definition. */
+  static TABLE_FIELD_DEF m_field_def;
+
+  /** Current row. */
+  row_ews_global_by_event_name m_row;
+};
+
+/** @} */
+#endif

=== removed file 'storage/perfschema/table_processlist.cc'
--- a/storage/perfschema/table_processlist.cc	2010-07-16 01:28:30 +0000
+++ b/storage/perfschema/table_processlist.cc	1970-01-01 00:00:00 +0000
@@ -1,177 +0,0 @@
-/* Copyright (c) 2008, 2010, 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
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software Foundation,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-/**
-  @file storage/perfschema/table_processlist.cc
-  Table PROCESSLIST (implementation).
-*/
-
-#include "my_global.h"
-#include "my_pthread.h"
-#include "table_processlist.h"
-#include "pfs_instr_class.h"
-#include "pfs_instr.h"
-
-THR_LOCK table_processlist::m_table_lock;
-
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("THREAD_ID") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ID") },
-    { C_STRING_WITH_LEN("int(11)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_processlist::m_field_def=
-{ 3, field_types };
-
-PFS_engine_table_share
-table_processlist::m_share=
-{
-  { C_STRING_WITH_LEN("PROCESSLIST") },
-  &pfs_readonly_acl,
-  &table_processlist::create,
-  NULL, /* write_row */
-  NULL, /* delete_all_rows */
-  1000, /* records */
-  sizeof(PFS_simple_index), /* ref length */
-  &m_table_lock,
-  &m_field_def,
-  false /* checked */
-};
-
-PFS_engine_table* table_processlist::create(void)
-{
-  return new table_processlist();
-}
-
-table_processlist::table_processlist()
-  : PFS_engine_table(&m_share, &m_pos),
-  m_row_exists(false), m_pos(0), m_next_pos(0)
-{}
-
-void table_processlist::reset_position(void)
-{
-  m_pos.m_index= 0;
-  m_next_pos.m_index= 0;
-}
-
-int table_processlist::rnd_next(void)
-{
-  PFS_thread *pfs;
-
-  for (m_pos.set_at(&m_next_pos);
-       m_pos.m_index < thread_max;
-       m_pos.next())
-  {
-    pfs= &thread_array[m_pos.m_index];
-    if (pfs->m_lock.is_populated())
-    {
-      make_row(pfs);
-      m_next_pos.set_after(&m_pos);
-      return 0;
-    }
-  }
-
-  return HA_ERR_END_OF_FILE;
-}
-
-int table_processlist::rnd_pos(const void *pos)
-{
-  PFS_thread *pfs;
-
-  set_position(pos);
-  DBUG_ASSERT(m_pos.m_index < thread_max);
-  pfs= &thread_array[m_pos.m_index];
-  if (pfs->m_lock.is_populated())
-  {
-    make_row(pfs);
-    return 0;
-  }
-
-  return HA_ERR_RECORD_DELETED;
-}
-
-void table_processlist::make_row(PFS_thread *pfs)
-{
-  pfs_lock lock;
-  PFS_thread_class *safe_class;
-
-  m_row_exists= false;
-
-  /* Protect this reader against thread termination */
-  pfs->m_lock.begin_optimistic_lock(&lock);
-
-  safe_class= sanitize_thread_class(pfs->m_class);
-  if (unlikely(safe_class == NULL))
-    return;
-
-  m_row.m_thread_internal_id= pfs->m_thread_internal_id;
-  m_row.m_thread_id= pfs->m_thread_id;
-  m_row.m_name= safe_class->m_name;
-  m_row.m_name_length= safe_class->m_name_length;
-
-  if (pfs->m_lock.end_optimistic_lock(&lock))
-    m_row_exists= true;
-}
-
-int table_processlist::read_row_values(TABLE *table,
-                                       unsigned char *,
-                                       Field **fields,
-                                       bool read_all)
-{
-  Field *f;
-
-  if (unlikely(! m_row_exists))
-    return HA_ERR_RECORD_DELETED;
-
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 0);
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (read_all || bitmap_is_set(table->read_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* THREAD_ID */
-        set_field_ulong(f, m_row.m_thread_internal_id);
-        break;
-      case 1: /* ID */
-        set_field_ulong(f, m_row.m_thread_id);
-        break;
-      case 2: /* NAME */
-        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-  return 0;
-}
-

=== removed file 'storage/perfschema/table_processlist.h'
--- a/storage/perfschema/table_processlist.h	2010-07-16 01:28:30 +0000
+++ b/storage/perfschema/table_processlist.h	1970-01-01 00:00:00 +0000
@@ -1,91 +0,0 @@
-/* Copyright (c) 2008, 2010, 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
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software Foundation,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef TABLE_PROCESSIST_H
-#define TABLE_PROCESSIST_H
-
-/**
-  @file storage/perfschema/table_processlist.h
-  Table PROCESSLIST (declarations).
-*/
-
-#include "pfs_column_types.h"
-#include "pfs_engine_table.h"
-
-struct PFS_thread;
-
-/**
-  @addtogroup Performance_schema_tables
-  @{
-*/
-
-/** A row of PERFORMANCE_SCHEMA.PROCESSLIST. */
-struct row_processlist
-{
-  /** Column THREAD_ID. */
-  ulong m_thread_internal_id;
-  /** Column ID. */
-  ulong m_thread_id;
-  /** Column NAME. */
-  const char *m_name;
-  /** Length in bytes of @c m_name. */
-  uint m_name_length;
-};
-
-/** Table PERFORMANCE_SCHEMA.PROCESSLIST. */
-class table_processlist : public PFS_engine_table
-{
-public:
-  /** Table share. */
-  static PFS_engine_table_share m_share;
-  static PFS_engine_table* create();
-
-  virtual int rnd_next();
-  virtual int rnd_pos(const void *pos);
-  virtual void reset_position(void);
-
-protected:
-  virtual int read_row_values(TABLE *table,
-                              unsigned char *buf,
-                              Field **fields,
-                              bool read_all);
-
-protected:
-  table_processlist();
-
-public:
-  ~table_processlist()
-  {}
-
-private:
-  void make_row(PFS_thread *pfs);
-
-  /** Table share lock. */
-  static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
-
-  /** Current row. */
-  row_processlist m_row;
-  /** True is the current row exists. */
-  bool m_row_exists;
-  /** Current position. */
-  PFS_simple_index m_pos;
-  /** Next position. */
-  PFS_simple_index m_next_pos;
-};
-
-/** @} */
-#endif

=== removed file 'storage/perfschema/table_setup_objects.cc'
--- a/storage/perfschema/table_setup_objects.cc	2010-06-15 14:46:02 +0000
+++ b/storage/perfschema/table_setup_objects.cc	1970-01-01 00:00:00 +0000
@@ -1,233 +0,0 @@
-/* Copyright (c) 2008, 2010, 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
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software Foundation,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-/**
-  @file storage/perfschema/table_setup_objects.cc
-  Table SETUP_OBJECTS (implementation).
-*/
-
-#include "my_global.h"
-#include "my_pthread.h"
-#include "pfs_instr_class.h"
-#include "pfs_column_types.h"
-#include "pfs_column_values.h"
-#include "table_setup_objects.h"
-#include "pfs_global.h"
-
-THR_LOCK table_setup_objects::m_table_lock;
-
-static const TABLE_FIELD_TYPE field_types[]=
-{
-  {
-    { C_STRING_WITH_LEN("OBJECT_TYPE") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_SCHEMA") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("OBJECT_NAME") },
-    { C_STRING_WITH_LEN("varchar(64)") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("ENABLED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("TIMED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  },
-  {
-    { C_STRING_WITH_LEN("AGGREGATED") },
-    { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") },
-    { NULL, 0}
-  }
-};
-
-TABLE_FIELD_DEF
-table_setup_objects::m_field_def=
-{ 6, field_types };
-
-PFS_engine_table_share
-table_setup_objects::m_share=
-{
-  { C_STRING_WITH_LEN("SETUP_OBJECTS") },
-  &pfs_editable_acl,
-  &table_setup_objects::create,
-  table_setup_objects::write_row,
-  table_setup_objects::delete_all_rows,
-  1000, /* records */
-  sizeof(pos_setup_objects),
-  &m_table_lock,
-  &m_field_def,
-  false /* checked */
-};
-
-PFS_engine_table* table_setup_objects::create(void)
-{
-  return new table_setup_objects();
-}
-
-int table_setup_objects::write_row(TABLE *table, unsigned char *buf,
-                                   Field **fields)
-{
-  /* Not implemented */
-  return HA_ERR_WRONG_COMMAND;
-}
-
-int table_setup_objects::delete_all_rows(void)
-{
-  /* Not implemented */
-  return HA_ERR_WRONG_COMMAND;
-}
-
-table_setup_objects::table_setup_objects()
-  : PFS_engine_table(&m_share, &m_pos),
-  m_row_exists(false), m_pos(), m_next_pos()
-{}
-
-void table_setup_objects::reset_position(void)
-{
-  m_pos.reset();
-  m_next_pos.reset();
-}
-
-int table_setup_objects::rnd_next(void)
-{
-  return HA_ERR_END_OF_FILE;
-}
-
-int table_setup_objects::rnd_pos(const void *pos)
-{
-  return HA_ERR_RECORD_DELETED;
-}
-
-void table_setup_objects::make_row(PFS_table_share *share)
-{
-  pfs_lock lock;
-
-  m_row_exists= false;
-  if (share == NULL)
-    return;
-
-  share->m_lock.begin_optimistic_lock(&lock);
-
-  m_row.m_schema_name= &share->m_schema_name[0];
-  m_row.m_schema_name_length= share->m_schema_name_length;
-  m_row.m_object_name= &share->m_table_name[0];
-  m_row.m_object_name_length= share->m_table_name_length;
-  m_row.m_enabled_ptr= &share->m_enabled;
-  m_row.m_timed_ptr= &share->m_timed;
-  m_row.m_aggregated_ptr= NULL;
-
-  if (share->m_lock.end_optimistic_lock(&lock))
-    m_row_exists= true;
-}
-
-int table_setup_objects::read_row_values(TABLE *table,
-                                         unsigned char *buf,
-                                         Field **fields,
-                                         bool read_all)
-{
-  Field *f;
-
-  if (unlikely(! m_row_exists))
-    return HA_ERR_RECORD_DELETED;
-
-  /* Set the null bits */
-  DBUG_ASSERT(table->s->null_bytes == 1);
-  buf[0]= 0;
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (read_all || bitmap_is_set(table->read_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* OBJECT_TYPE */
-        set_field_varchar_utf8(f, "TABLE", 5);
-        break;
-      case 1: /* OBJECT_SCHEMA */
-        set_field_varchar_utf8(f, m_row.m_schema_name,
-                               m_row.m_schema_name_length);
-        break;
-      case 2: /* OBJECT_NAME */
-        set_field_varchar_utf8(f, m_row.m_object_name,
-                               m_row.m_object_name_length);
-        break;
-      case 3: /* ENABLED */
-        set_field_enum(f, (*m_row.m_enabled_ptr) ? ENUM_YES : ENUM_NO);
-        break;
-      case 4: /* TIMED */
-        set_field_enum(f, (*m_row.m_timed_ptr) ? ENUM_YES : ENUM_NO);
-        break;
-      case 5: /* AGGREGATED */
-        set_field_enum(f, (*m_row.m_aggregated_ptr) ? ENUM_YES : ENUM_NO);
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-
-  return 0;
-}
-
-int table_setup_objects::update_row_values(TABLE *table,
-                                           const unsigned char *,
-                                           unsigned char *,
-                                           Field **fields)
-{
-  Field *f;
-  enum_yes_no value;
-
-  for (; (f= *fields) ; fields++)
-  {
-    if (bitmap_is_set(table->write_set, f->field_index))
-    {
-      switch(f->field_index)
-      {
-      case 0: /* OBJECT_TYPE */
-      case 1: /* OBJECT_SCHEMA */
-      case 2: /* OBJECT_NAME */
-        my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
-        return HA_ERR_WRONG_COMMAND;
-      case 3: /* ENABLED */
-        value= (enum_yes_no) get_field_enum(f);
-        *m_row.m_enabled_ptr= (value == ENUM_YES) ? true : false;
-        break;
-      case 4: /* TIMED */
-        value= (enum_yes_no) get_field_enum(f);
-        *m_row.m_timed_ptr= (value == ENUM_YES) ? true : false;
-        break;
-      case 5: /* AGGREGATED */
-        value= (enum_yes_no) get_field_enum(f);
-        *m_row.m_aggregated_ptr= (value == ENUM_YES) ? true : false;
-        break;
-      default:
-        DBUG_ASSERT(false);
-      }
-    }
-  }
-
-  return 0;
-}
-

=== removed file 'storage/perfschema/table_setup_objects.h'
--- a/storage/perfschema/table_setup_objects.h	2010-06-15 14:46:02 +0000
+++ b/storage/perfschema/table_setup_objects.h	1970-01-01 00:00:00 +0000
@@ -1,126 +0,0 @@
-/* Copyright (c) 2008, 2010, 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
-  the Free Software Foundation; version 2 of the License.
-
-  This program is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software Foundation,
-  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
-
-#ifndef TABLE_SETUP_OBJECTS_H
-#define TABLE_SETUP_OBJECTS_H
-
-/**
-  @file storage/perfschema/table_setup_objects.h
-  Table SETUP_OBJECTS (declarations).
-*/
-
-#include "pfs_instr_class.h"
-#include "pfs_engine_table.h"
-#include "table_helper.h"
-
-/**
-  @addtogroup Performance_schema_tables
-  @{
-*/
-
-/** A row of PERFORMANCE_SCHEMA.SETUP_OBJECTS. */
-struct row_setup_objects
-{
-  /** Column SCHEMA_NAME. */
-  const char *m_schema_name;
-  /** Length in bytes of @c m_schema_name. */
-  uint m_schema_name_length;
-  /** Column OBJECT_NAME. */
-  const char *m_object_name;
-  /** Length in bytes of @c m_object_name. */
-  uint m_object_name_length;
-  /** Column ENABLED. */
-  bool *m_enabled_ptr;
-  /** Column TIMED. */
-  bool *m_timed_ptr;
-  /** Column AGGREGATED. */
-  bool *m_aggregated_ptr;
-};
-
-/** Position of a cursor on PERFORMANCE_SCHEMA.SETUP_OBJECTS. */
-struct pos_setup_objects : public PFS_double_index,
-                           public PFS_object_view_constants
-{
-  pos_setup_objects()
-    : PFS_double_index(FIRST_VIEW, 0)
-  {}
-
-  inline void reset(void)
-  {
-    m_index_1= FIRST_VIEW;
-    m_index_2= 0;
-  }
-
-  inline bool has_more_view(void)
-  { return (m_index_1 <= LAST_VIEW); }
-
-  inline void next_view(void)
-  {
-    m_index_1++;
-    m_index_2= 0;
-  }
-};
-
-/** Table PERFORMANCE_SCHEMA.SETUP_OBJECTS. */
-class table_setup_objects : public PFS_engine_table
-{
-public:
-  /** Table share. */
-  static PFS_engine_table_share m_share;
-  static PFS_engine_table* create();
-  static int write_row(TABLE *table, unsigned char *buf, Field **fields);
-  static int delete_all_rows();
-
-  virtual int rnd_next();
-  virtual int rnd_pos(const void *pos);
-  virtual void reset_position(void);
-
-protected:
-  virtual int read_row_values(TABLE *table,
-                              unsigned char *buf,
-                              Field **fields,
-                              bool read_all);
-
-  virtual int update_row_values(TABLE *table,
-                                const unsigned char *old_buf,
-                                unsigned char *new_buf,
-                                Field **fields);
-
-  table_setup_objects();
-
-public:
-  ~table_setup_objects()
-  {}
-
-private:
-  void make_row(PFS_table_share *share);
-
-  /** Table share lock. */
-  static THR_LOCK m_table_lock;
-  /** Fields definition. */
-  static TABLE_FIELD_DEF m_field_def;
-
-  /** Current row. */
-  row_setup_objects m_row;
-  /** True is the current row exists. */
-  bool m_row_exists;
-  /** Current position. */
-  pos_setup_objects m_pos;
-  /** Next position. */
-  pos_setup_objects m_next_pos;
-};
-
-/** @} */
-#endif

=== added file 'storage/perfschema/table_threads.cc'
--- a/storage/perfschema/table_threads.cc	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_threads.cc	2010-08-12 14:08:52 +0000
@@ -0,0 +1,177 @@
+/* Copyright (c) 2008, 2010, 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
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software Foundation,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+/**
+  @file storage/perfschema/table_threads.cc
+  Table THREADS (implementation).
+*/
+
+#include "my_global.h"
+#include "my_pthread.h"
+#include "table_threads.h"
+#include "pfs_instr_class.h"
+#include "pfs_instr.h"
+
+THR_LOCK table_threads::m_table_lock;
+
+static const TABLE_FIELD_TYPE field_types[]=
+{
+  {
+    { C_STRING_WITH_LEN("THREAD_ID") },
+    { C_STRING_WITH_LEN("int(11)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("ID") },
+    { C_STRING_WITH_LEN("int(11)") },
+    { NULL, 0}
+  },
+  {
+    { C_STRING_WITH_LEN("NAME") },
+    { C_STRING_WITH_LEN("varchar(64)") },
+    { NULL, 0}
+  }
+};
+
+TABLE_FIELD_DEF
+table_threads::m_field_def=
+{ 3, field_types };
+
+PFS_engine_table_share
+table_threads::m_share=
+{
+  { C_STRING_WITH_LEN("THREADS") },
+  &pfs_readonly_acl,
+  &table_threads::create,
+  NULL, /* write_row */
+  NULL, /* delete_all_rows */
+  1000, /* records */
+  sizeof(PFS_simple_index), /* ref length */
+  &m_table_lock,
+  &m_field_def,
+  false /* checked */
+};
+
+PFS_engine_table* table_threads::create(void)
+{
+  return new table_threads();
+}
+
+table_threads::table_threads()
+  : PFS_engine_table(&m_share, &m_pos),
+  m_row_exists(false), m_pos(0), m_next_pos(0)
+{}
+
+void table_threads::reset_position(void)
+{
+  m_pos.m_index= 0;
+  m_next_pos.m_index= 0;
+}
+
+int table_threads::rnd_next(void)
+{
+  PFS_thread *pfs;
+
+  for (m_pos.set_at(&m_next_pos);
+       m_pos.m_index < thread_max;
+       m_pos.next())
+  {
+    pfs= &thread_array[m_pos.m_index];
+    if (pfs->m_lock.is_populated())
+    {
+      make_row(pfs);
+      m_next_pos.set_after(&m_pos);
+      return 0;
+    }
+  }
+
+  return HA_ERR_END_OF_FILE;
+}
+
+int table_threads::rnd_pos(const void *pos)
+{
+  PFS_thread *pfs;
+
+  set_position(pos);
+  DBUG_ASSERT(m_pos.m_index < thread_max);
+  pfs= &thread_array[m_pos.m_index];
+  if (pfs->m_lock.is_populated())
+  {
+    make_row(pfs);
+    return 0;
+  }
+
+  return HA_ERR_RECORD_DELETED;
+}
+
+void table_threads::make_row(PFS_thread *pfs)
+{
+  pfs_lock lock;
+  PFS_thread_class *safe_class;
+
+  m_row_exists= false;
+
+  /* Protect this reader against thread termination */
+  pfs->m_lock.begin_optimistic_lock(&lock);
+
+  safe_class= sanitize_thread_class(pfs->m_class);
+  if (unlikely(safe_class == NULL))
+    return;
+
+  m_row.m_thread_internal_id= pfs->m_thread_internal_id;
+  m_row.m_thread_id= pfs->m_thread_id;
+  m_row.m_name= safe_class->m_name;
+  m_row.m_name_length= safe_class->m_name_length;
+
+  if (pfs->m_lock.end_optimistic_lock(&lock))
+    m_row_exists= true;
+}
+
+int table_threads::read_row_values(TABLE *table,
+                                   unsigned char *,
+                                   Field **fields,
+                                   bool read_all)
+{
+  Field *f;
+
+  if (unlikely(! m_row_exists))
+    return HA_ERR_RECORD_DELETED;
+
+  /* Set the null bits */
+  DBUG_ASSERT(table->s->null_bytes == 0);
+
+  for (; (f= *fields) ; fields++)
+  {
+    if (read_all || bitmap_is_set(table->read_set, f->field_index))
+    {
+      switch(f->field_index)
+      {
+      case 0: /* THREAD_ID */
+        set_field_ulong(f, m_row.m_thread_internal_id);
+        break;
+      case 1: /* ID */
+        set_field_ulong(f, m_row.m_thread_id);
+        break;
+      case 2: /* NAME */
+        set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length);
+        break;
+      default:
+        DBUG_ASSERT(false);
+      }
+    }
+  }
+  return 0;
+}
+

=== added file 'storage/perfschema/table_threads.h'
--- a/storage/perfschema/table_threads.h	1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_threads.h	2010-08-12 14:08:52 +0000
@@ -0,0 +1,91 @@
+/* Copyright (c) 2008, 2010, 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
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program; if not, write to the Free Software Foundation,
+  51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
+
+#ifndef TABLE_THREADS_H
+#define TABLE_THREADS_H
+
+/**
+  @file storage/perfschema/table_threads.h
+  Table THREADS (declarations).
+*/
+
+#include "pfs_column_types.h"
+#include "pfs_engine_table.h"
+
+struct PFS_thread;
+
+/**
+  @addtogroup Performance_schema_tables
+  @{
+*/
+
+/** A row of PERFORMANCE_SCHEMA.THREADS. */
+struct row_threads
+{
+  /** Column THREAD_ID. */
+  ulong m_thread_internal_id;
+  /** Column ID. */
+  ulong m_thread_id;
+  /** Column NAME. */
+  const char *m_name;
+  /** Length in bytes of @c m_name. */
+  uint m_name_length;
+};
+
+/** Table PERFORMANCE_SCHEMA.THREADS. */
+class table_threads : public PFS_engine_table
+{
+public:
+  /** Table share. */
+  static PFS_engine_table_share m_share;
+  static PFS_engine_table* create();
+
+  virtual int rnd_next();
+  virtual int rnd_pos(const void *pos);
+  virtual void reset_position(void);
+
+protected:
+  virtual int read_row_values(TABLE *table,
+                              unsigned char *buf,
+                              Field **fields,
+                              bool read_all);
+
+protected:
+  table_threads();
+
+public:
+  ~table_threads()
+  {}
+
+private:
+  void make_row(PFS_thread *pfs);
+
+  /** Table share lock. */
+  static THR_LOCK m_table_lock;
+  /** Fields definition. */
+  static TABLE_FIELD_DEF m_field_def;
+
+  /** Current row. */
+  row_threads m_row;
+  /** True is the current row exists. */
+  bool m_row_exists;
+  /** Current position. */
+  PFS_simple_index m_pos;
+  /** Next position. */
+  PFS_simple_index m_next_pos;
+};
+
+/** @} */
+#endif


Attachment: [text/bzr-bundle] bzr/marc.alff@oracle.com-20100812155307-ghqmho7ho9bs12dm.bundle
Thread
bzr push into mysql-next-mr-bugfixing branch (marc.alff:3207 to 3208) Marc Alff12 Aug