#At file:///Users/malff/BZR_TREE/mysql-next-mr-wl4674/ based on revid:marc.alff@stripped
3144 Marc Alff 2010-05-12
WL#4674 PERFORMANCE SCHEMA SETUP_ACTORS
Port, continued.
removed:
mysql-test/suite/perfschema/t/schema.test
added:
mysql-test/suite/perfschema/include/schema.inc
mysql-test/suite/perfschema/r/ddl_setup_actors.result
mysql-test/suite/perfschema/r/dml_setup_actors.result
mysql-test/suite/perfschema/r/schema_lc0.result
mysql-test/suite/perfschema/r/schema_lc1.result
mysql-test/suite/perfschema/r/schema_lc2.result
mysql-test/suite/perfschema/t/ddl_setup_actors.test
mysql-test/suite/perfschema/t/dml_setup_actors.test
mysql-test/suite/perfschema/t/schema_lc0.test
mysql-test/suite/perfschema/t/schema_lc1.test
mysql-test/suite/perfschema/t/schema_lc2.test
storage/perfschema/table_setup_actors.cc
storage/perfschema/table_setup_actors.h
modified:
mysql-test/r/mysqld--help-notwin.result
mysql-test/r/mysqld--help-win.result
mysql-test/suite/perfschema/include/start_server_common.inc
mysql-test/suite/perfschema/r/information_schema.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_thread_class.result
mysql-test/suite/perfschema/r/start_server_no_thread_inst.result
mysql-test/suite/perfschema/r/start_server_off.result
mysql-test/suite/perfschema/r/start_server_on.result
scripts/mysql_system_tables.sql
storage/perfschema/CMakeLists.txt
storage/perfschema/Makefile.am
storage/perfschema/pfs_engine_table.cc
=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result 2010-03-24 15:03:44 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result 2010-05-12 14:04:32 +0000
@@ -438,6 +438,8 @@ The following options may be given as th
Maximum number of thread instruments.
--performance-schema-max-thread-instances=#
Maximum number of instrumented threads.
+ --performance-schema-setup-actors-size=#
+ Maximum number of rows in SETUP_ACTORS.
--pid-file=name Pid file used by safe_mysqld
--plugin-dir=name Directory for plugins
--plugin-load=name Optional semicolon-separated list of plugins to load,
@@ -867,6 +869,7 @@ performance-schema-max-table-handles 100
performance-schema-max-table-instances 50000
performance-schema-max-thread-classes 50
performance-schema-max-thread-instances 1000
+performance-schema-setup-actors-size 100
plugin-load (No default value)
port 3306
port-open-timeout 0
=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result 2010-03-24 20:29:38 +0000
+++ b/mysql-test/r/mysqld--help-win.result 2010-05-12 14:04:32 +0000
@@ -438,6 +438,8 @@ The following options may be given as th
Maximum number of thread instruments.
--performance-schema-max-thread-instances=#
Maximum number of instrumented threads.
+ --performance-schema-setup-actors-size=#
+ Maximum number of rows in SETUP_ACTORS.
--pid-file=name Pid file used by safe_mysqld
--plugin-dir=name Directory for plugins
--plugin-load=name Optional semicolon-separated list of plugins to load,
@@ -871,6 +873,7 @@ performance-schema-max-table-handles 100
performance-schema-max-table-instances 50000
performance-schema-max-thread-classes 50
performance-schema-max-thread-instances 1000
+performance-schema-setup-actors-size 100
plugin-load (No default value)
port 3306
port-open-timeout 0
=== added file 'mysql-test/suite/perfschema/include/schema.inc'
--- a/mysql-test/suite/perfschema/include/schema.inc 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/include/schema.inc 2010-05-12 14:04:32 +0000
@@ -0,0 +1,43 @@
+# 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, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# Tests for PERFORMANCE_SCHEMA
+
+show databases;
+
+use performance_schema;
+
+show tables;
+
+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 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 RWLOCK_INSTANCES;
+show create table SETUP_ACTORS;
+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/include/start_server_common.inc'
--- a/mysql-test/suite/perfschema/include/start_server_common.inc 2010-05-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/include/start_server_common.inc 2010-05-12 14:04:32 +0000
@@ -38,6 +38,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== added file 'mysql-test/suite/perfschema/r/ddl_setup_actors.result'
--- a/mysql-test/suite/perfschema/r/ddl_setup_actors.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/ddl_setup_actors.result 2010-05-12 14:04:32 +0000
@@ -0,0 +1,16 @@
+alter table performance_schema.SETUP_ACTORS add column foo integer;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+drop table if exists test.SETUP_ACTORS;
+create table test.SETUP_ACTORS as
+select * from performance_schema.SETUP_ACTORS;
+truncate table performance_schema.SETUP_ACTORS;
+select count(*) from performance_schema.SETUP_ACTORS;
+count(*)
+0
+insert into performance_schema.SETUP_ACTORS
+select * from test.SETUP_ACTORS;
+drop table test.SETUP_ACTORS;
+ALTER TABLE performance_schema.SETUP_ACTORS ADD INDEX test_index(HOST);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
+CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_ACTORS(HOST);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
=== added file 'mysql-test/suite/perfschema/r/dml_setup_actors.result'
--- a/mysql-test/suite/perfschema/r/dml_setup_actors.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/dml_setup_actors.result 2010-05-12 14:04:32 +0000
@@ -0,0 +1,60 @@
+drop table if exists test.SETUP_ACTORS;
+create table test.SETUP_ACTORS as
+select * from performance_schema.SETUP_ACTORS;
+truncate table performance_schema.SETUP_ACTORS;
+select * from performance_schema.SETUP_ACTORS;
+HOST USER ROLE
+select * from performance_schema.SETUP_ACTORS
+where user = '%';
+HOST USER ROLE
+insert into performance_schema.SETUP_ACTORS
+set user='Joe', host='localhost';
+insert into performance_schema.SETUP_ACTORS
+set user='Joe', host='%';
+insert into performance_schema.SETUP_ACTORS
+set user='%', host='server1';
+insert into performance_schema.SETUP_ACTORS
+set user='%', host='%';
+select * from performance_schema.SETUP_ACTORS
+order by USER, HOST;
+HOST USER ROLE
+% % %
+server1 % %
+% Joe %
+localhost Joe %
+update performance_schema.SETUP_ACTORS
+set user='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.SETUP_ACTORS
+set host='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+update performance_schema.SETUP_ACTORS
+set role='ILLEGAL';
+ERROR HY000: Invalid performance_schema usage.
+select * from performance_schema.SETUP_ACTORS
+order by USER, HOST;
+HOST USER ROLE
+% % %
+server1 % %
+% Joe %
+localhost Joe %
+delete from performance_schema.SETUP_ACTORS
+where user = 'Joe' and host = 'localhost';
+select * from performance_schema.SETUP_ACTORS
+order by USER, HOST;
+HOST USER ROLE
+% % %
+server1 % %
+% Joe %
+delete from performance_schema.SETUP_ACTORS;
+select * from performance_schema.SETUP_ACTORS
+order by USER, HOST;
+HOST USER ROLE
+LOCK TABLES performance_schema.SETUP_ACTORS READ;
+UNLOCK TABLES;
+LOCK TABLES performance_schema.SETUP_ACTORS WRITE;
+UNLOCK TABLES;
+truncate table performance_schema.SETUP_ACTORS;
+insert into performance_schema.SETUP_ACTORS
+select * from test.SETUP_ACTORS;
+drop table test.SETUP_ACTORS;
=== modified file 'mysql-test/suite/perfschema/r/information_schema.result'
--- a/mysql-test/suite/perfschema/r/information_schema.result 2010-05-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/information_schema.result 2010-05-12 14:04:32 +0000
@@ -15,6 +15,7 @@ performance_schema FILE_SUMMARY_BY_INSTA
performance_schema MUTEX_INSTANCES def
performance_schema PERFORMANCE_TIMERS def
performance_schema RWLOCK_INSTANCES def
+performance_schema SETUP_ACTORS def
performance_schema SETUP_CONSUMERS def
performance_schema SETUP_INSTRUMENTS def
performance_schema SETUP_OBJECTS def
@@ -37,6 +38,7 @@ FILE_SUMMARY_BY_INSTANCE BASE TABLE PERF
MUTEX_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
PERFORMANCE_TIMERS BASE TABLE PERFORMANCE_SCHEMA
RWLOCK_INSTANCES BASE TABLE PERFORMANCE_SCHEMA
+SETUP_ACTORS BASE TABLE PERFORMANCE_SCHEMA
SETUP_CONSUMERS BASE TABLE PERFORMANCE_SCHEMA
SETUP_INSTRUMENTS BASE TABLE PERFORMANCE_SCHEMA
SETUP_OBJECTS BASE TABLE PERFORMANCE_SCHEMA
@@ -59,6 +61,7 @@ FILE_SUMMARY_BY_INSTANCE 10 Dynamic
MUTEX_INSTANCES 10 Dynamic
PERFORMANCE_TIMERS 10 Fixed
RWLOCK_INSTANCES 10 Dynamic
+SETUP_ACTORS 10 Fixed
SETUP_CONSUMERS 10 Dynamic
SETUP_INSTRUMENTS 10 Dynamic
SETUP_OBJECTS 10 Dynamic
@@ -81,6 +84,7 @@ FILE_SUMMARY_BY_INSTANCE 1000 0
MUTEX_INSTANCES 1000 0
PERFORMANCE_TIMERS 5 0
RWLOCK_INSTANCES 1000 0
+SETUP_ACTORS 1 0
SETUP_CONSUMERS 8 0
SETUP_INSTRUMENTS 1000 0
SETUP_OBJECTS 1000 0
@@ -103,6 +107,7 @@ FILE_SUMMARY_BY_INSTANCE 0 0
MUTEX_INSTANCES 0 0
PERFORMANCE_TIMERS 0 0
RWLOCK_INSTANCES 0 0
+SETUP_ACTORS 0 0
SETUP_CONSUMERS 0 0
SETUP_INSTRUMENTS 0 0
SETUP_OBJECTS 0 0
@@ -125,6 +130,7 @@ FILE_SUMMARY_BY_INSTANCE 0 0 NULL
MUTEX_INSTANCES 0 0 NULL
PERFORMANCE_TIMERS 0 0 NULL
RWLOCK_INSTANCES 0 0 NULL
+SETUP_ACTORS 0 0 NULL
SETUP_CONSUMERS 0 0 NULL
SETUP_INSTRUMENTS 0 0 NULL
SETUP_OBJECTS 0 0 NULL
@@ -147,6 +153,7 @@ FILE_SUMMARY_BY_INSTANCE NULL NULL NULL
MUTEX_INSTANCES NULL NULL NULL
PERFORMANCE_TIMERS NULL NULL NULL
RWLOCK_INSTANCES NULL NULL NULL
+SETUP_ACTORS NULL NULL NULL
SETUP_CONSUMERS NULL NULL NULL
SETUP_INSTRUMENTS NULL NULL NULL
SETUP_OBJECTS NULL NULL NULL
@@ -169,6 +176,7 @@ FILE_SUMMARY_BY_INSTANCE utf8_general_ci
MUTEX_INSTANCES utf8_general_ci NULL
PERFORMANCE_TIMERS utf8_general_ci NULL
RWLOCK_INSTANCES utf8_general_ci NULL
+SETUP_ACTORS utf8_general_ci NULL
SETUP_CONSUMERS utf8_general_ci NULL
SETUP_INSTRUMENTS utf8_general_ci NULL
SETUP_OBJECTS utf8_general_ci NULL
@@ -191,6 +199,7 @@ FILE_SUMMARY_BY_INSTANCE
MUTEX_INSTANCES
PERFORMANCE_TIMERS
RWLOCK_INSTANCES
+SETUP_ACTORS
SETUP_CONSUMERS
SETUP_INSTRUMENTS
SETUP_OBJECTS
=== added file 'mysql-test/suite/perfschema/r/schema_lc0.result'
--- a/mysql-test/suite/perfschema/r/schema_lc0.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/schema_lc0.result 2010-05-12 14:04:32 +0000
@@ -0,0 +1,230 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+use performance_schema;
+show tables;
+Tables_in_performance_schema
+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
+FILE_INSTANCES
+FILE_SUMMARY_BY_EVENT_NAME
+FILE_SUMMARY_BY_INSTANCE
+MUTEX_INSTANCES
+PERFORMANCE_TIMERS
+RWLOCK_INSTANCES
+SETUP_ACTORS
+SETUP_CONSUMERS
+SETUP_INSTRUMENTS
+SETUP_OBJECTS
+SETUP_TIMERS
+THREADS
+show create table COND_INSTANCES;
+Table Create Table
+COND_INSTANCES CREATE TABLE `COND_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table EVENTS_WAITS_CURRENT;
+Table Create Table
+EVENTS_WAITS_CURRENT CREATE TABLE `EVENTS_WAITS_CURRENT` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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_HISTORY;
+Table Create Table
+EVENTS_WAITS_HISTORY CREATE TABLE `EVENTS_WAITS_HISTORY` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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_HISTORY_LONG;
+Table Create Table
+EVENTS_WAITS_HISTORY_LONG CREATE TABLE `EVENTS_WAITS_HISTORY_LONG` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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;
+Table Create Table
+EVENTS_WAITS_SUMMARY_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_EVENT_NAME` (
+ `EVENT_NAME` varchar(128) 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;
+Table Create Table
+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_THREAD_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,
+ `EVENT_NAME` varchar(128) 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 FILE_INSTANCES;
+Table Create Table
+FILE_INSTANCES CREATE TABLE `FILE_INSTANCES` (
+ `FILE_NAME` varchar(512) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `OPEN_COUNT` int(10) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table FILE_SUMMARY_BY_EVENT_NAME;
+Table Create Table
+FILE_SUMMARY_BY_EVENT_NAME CREATE TABLE `FILE_SUMMARY_BY_EVENT_NAME` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table FILE_SUMMARY_BY_INSTANCE;
+Table Create Table
+FILE_SUMMARY_BY_INSTANCE CREATE TABLE `FILE_SUMMARY_BY_INSTANCE` (
+ `FILE_NAME` varchar(512) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table MUTEX_INSTANCES;
+Table Create Table
+MUTEX_INSTANCES CREATE TABLE `MUTEX_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table PERFORMANCE_TIMERS;
+Table Create Table
+PERFORMANCE_TIMERS CREATE TABLE `PERFORMANCE_TIMERS` (
+ `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL,
+ `TIMER_FREQUENCY` bigint(20) DEFAULT NULL,
+ `TIMER_RESOLUTION` bigint(20) DEFAULT NULL,
+ `TIMER_OVERHEAD` bigint(20) DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table RWLOCK_INSTANCES;
+Table Create Table
+RWLOCK_INSTANCES CREATE TABLE `RWLOCK_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `WRITE_LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL,
+ `READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_ACTORS;
+Table Create Table
+SETUP_ACTORS CREATE TABLE `SETUP_ACTORS` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `ROLE` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%'
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_CONSUMERS;
+Table Create Table
+SETUP_CONSUMERS CREATE TABLE `SETUP_CONSUMERS` (
+ `NAME` varchar(64) NOT NULL,
+ `ENABLED` enum('YES','NO') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_INSTRUMENTS;
+Table Create Table
+SETUP_INSTRUMENTS CREATE TABLE `SETUP_INSTRUMENTS` (
+ `NAME` varchar(128) NOT NULL,
+ `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,
+ `NAME` varchar(128) NOT NULL,
+ `TYPE` varchar(10) NOT NULL,
+ `PROCESSLIST_ID` int(11) DEFAULT NULL,
+ `PROCESSLIST_USER` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_HOST` varchar(60) DEFAULT NULL,
+ `PROCESSLIST_DB` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_TIME` bigint(20) DEFAULT NULL,
+ `PROCESSLIST_STATE` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_INFO` longtext,
+ `PARENT_THREAD_ID` int(11) DEFAULT NULL,
+ `ROLE` varchar(64) DEFAULT NULL,
+ `INSTRUMENTED` enum('YES','NO') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
=== added file 'mysql-test/suite/perfschema/r/schema_lc1.result'
--- a/mysql-test/suite/perfschema/r/schema_lc1.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/schema_lc1.result 2010-05-12 14:04:32 +0000
@@ -0,0 +1,230 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+use performance_schema;
+show tables;
+Tables_in_performance_schema
+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
+FILE_INSTANCES
+FILE_SUMMARY_BY_EVENT_NAME
+FILE_SUMMARY_BY_INSTANCE
+MUTEX_INSTANCES
+PERFORMANCE_TIMERS
+RWLOCK_INSTANCES
+SETUP_ACTORS
+SETUP_CONSUMERS
+SETUP_INSTRUMENTS
+SETUP_OBJECTS
+SETUP_TIMERS
+THREADS
+show create table COND_INSTANCES;
+Table Create Table
+COND_INSTANCES CREATE TABLE `COND_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table EVENTS_WAITS_CURRENT;
+Table Create Table
+EVENTS_WAITS_CURRENT CREATE TABLE `EVENTS_WAITS_CURRENT` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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_HISTORY;
+Table Create Table
+EVENTS_WAITS_HISTORY CREATE TABLE `EVENTS_WAITS_HISTORY` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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_HISTORY_LONG;
+Table Create Table
+EVENTS_WAITS_HISTORY_LONG CREATE TABLE `EVENTS_WAITS_HISTORY_LONG` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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;
+Table Create Table
+EVENTS_WAITS_SUMMARY_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_EVENT_NAME` (
+ `EVENT_NAME` varchar(128) 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;
+Table Create Table
+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_THREAD_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,
+ `EVENT_NAME` varchar(128) 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 FILE_INSTANCES;
+Table Create Table
+FILE_INSTANCES CREATE TABLE `FILE_INSTANCES` (
+ `FILE_NAME` varchar(512) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `OPEN_COUNT` int(10) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table FILE_SUMMARY_BY_EVENT_NAME;
+Table Create Table
+FILE_SUMMARY_BY_EVENT_NAME CREATE TABLE `FILE_SUMMARY_BY_EVENT_NAME` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table FILE_SUMMARY_BY_INSTANCE;
+Table Create Table
+FILE_SUMMARY_BY_INSTANCE CREATE TABLE `FILE_SUMMARY_BY_INSTANCE` (
+ `FILE_NAME` varchar(512) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table MUTEX_INSTANCES;
+Table Create Table
+MUTEX_INSTANCES CREATE TABLE `MUTEX_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table PERFORMANCE_TIMERS;
+Table Create Table
+PERFORMANCE_TIMERS CREATE TABLE `PERFORMANCE_TIMERS` (
+ `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL,
+ `TIMER_FREQUENCY` bigint(20) DEFAULT NULL,
+ `TIMER_RESOLUTION` bigint(20) DEFAULT NULL,
+ `TIMER_OVERHEAD` bigint(20) DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table RWLOCK_INSTANCES;
+Table Create Table
+RWLOCK_INSTANCES CREATE TABLE `RWLOCK_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `WRITE_LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL,
+ `READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_ACTORS;
+Table Create Table
+SETUP_ACTORS CREATE TABLE `SETUP_ACTORS` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `ROLE` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%'
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_CONSUMERS;
+Table Create Table
+SETUP_CONSUMERS CREATE TABLE `SETUP_CONSUMERS` (
+ `NAME` varchar(64) NOT NULL,
+ `ENABLED` enum('YES','NO') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_INSTRUMENTS;
+Table Create Table
+SETUP_INSTRUMENTS CREATE TABLE `SETUP_INSTRUMENTS` (
+ `NAME` varchar(128) NOT NULL,
+ `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,
+ `NAME` varchar(128) NOT NULL,
+ `TYPE` varchar(10) NOT NULL,
+ `PROCESSLIST_ID` int(11) DEFAULT NULL,
+ `PROCESSLIST_USER` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_HOST` varchar(60) DEFAULT NULL,
+ `PROCESSLIST_DB` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_TIME` bigint(20) DEFAULT NULL,
+ `PROCESSLIST_STATE` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_INFO` longtext,
+ `PARENT_THREAD_ID` int(11) DEFAULT NULL,
+ `ROLE` varchar(64) DEFAULT NULL,
+ `INSTRUMENTED` enum('YES','NO') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
=== added file 'mysql-test/suite/perfschema/r/schema_lc2.result'
--- a/mysql-test/suite/perfschema/r/schema_lc2.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/r/schema_lc2.result 2010-05-12 14:04:32 +0000
@@ -0,0 +1,230 @@
+show databases;
+Database
+information_schema
+mtr
+mysql
+performance_schema
+test
+use performance_schema;
+show tables;
+Tables_in_performance_schema
+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
+FILE_INSTANCES
+FILE_SUMMARY_BY_EVENT_NAME
+FILE_SUMMARY_BY_INSTANCE
+MUTEX_INSTANCES
+PERFORMANCE_TIMERS
+RWLOCK_INSTANCES
+SETUP_ACTORS
+SETUP_CONSUMERS
+SETUP_INSTRUMENTS
+SETUP_OBJECTS
+SETUP_TIMERS
+THREADS
+show create table COND_INSTANCES;
+Table Create Table
+COND_INSTANCES CREATE TABLE `COND_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table EVENTS_WAITS_CURRENT;
+Table Create Table
+EVENTS_WAITS_CURRENT CREATE TABLE `EVENTS_WAITS_CURRENT` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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_HISTORY;
+Table Create Table
+EVENTS_WAITS_HISTORY CREATE TABLE `EVENTS_WAITS_HISTORY` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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_HISTORY_LONG;
+Table Create Table
+EVENTS_WAITS_HISTORY_LONG CREATE TABLE `EVENTS_WAITS_HISTORY_LONG` (
+ `THREAD_ID` int(11) NOT NULL,
+ `EVENT_ID` bigint(20) unsigned NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `SOURCE` varchar(64) DEFAULT NULL,
+ `TIMER_START` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_END` bigint(20) unsigned DEFAULT NULL,
+ `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL,
+ `SPINS` int(10) unsigned DEFAULT NULL,
+ `OBJECT_SCHEMA` varchar(64) DEFAULT NULL,
+ `OBJECT_NAME` varchar(512) DEFAULT NULL,
+ `OBJECT_TYPE` varchar(64) DEFAULT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL,
+ `OPERATION` varchar(16) NOT NULL,
+ `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;
+Table Create Table
+EVENTS_WAITS_SUMMARY_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_EVENT_NAME` (
+ `EVENT_NAME` varchar(128) 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;
+Table Create Table
+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_THREAD_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,
+ `EVENT_NAME` varchar(128) 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 FILE_INSTANCES;
+Table Create Table
+FILE_INSTANCES CREATE TABLE `FILE_INSTANCES` (
+ `FILE_NAME` varchar(512) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `OPEN_COUNT` int(10) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table FILE_SUMMARY_BY_EVENT_NAME;
+Table Create Table
+FILE_SUMMARY_BY_EVENT_NAME CREATE TABLE `FILE_SUMMARY_BY_EVENT_NAME` (
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table FILE_SUMMARY_BY_INSTANCE;
+Table Create Table
+FILE_SUMMARY_BY_INSTANCE CREATE TABLE `FILE_SUMMARY_BY_INSTANCE` (
+ `FILE_NAME` varchar(512) NOT NULL,
+ `EVENT_NAME` varchar(128) NOT NULL,
+ `COUNT_READ` bigint(20) unsigned NOT NULL,
+ `COUNT_WRITE` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL,
+ `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table MUTEX_INSTANCES;
+Table Create Table
+MUTEX_INSTANCES CREATE TABLE `MUTEX_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table PERFORMANCE_TIMERS;
+Table Create Table
+PERFORMANCE_TIMERS CREATE TABLE `PERFORMANCE_TIMERS` (
+ `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL,
+ `TIMER_FREQUENCY` bigint(20) DEFAULT NULL,
+ `TIMER_RESOLUTION` bigint(20) DEFAULT NULL,
+ `TIMER_OVERHEAD` bigint(20) DEFAULT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table RWLOCK_INSTANCES;
+Table Create Table
+RWLOCK_INSTANCES CREATE TABLE `RWLOCK_INSTANCES` (
+ `NAME` varchar(128) NOT NULL,
+ `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL,
+ `WRITE_LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL,
+ `READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_ACTORS;
+Table Create Table
+SETUP_ACTORS CREATE TABLE `SETUP_ACTORS` (
+ `HOST` char(60) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `USER` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%',
+ `ROLE` char(16) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '%'
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_CONSUMERS;
+Table Create Table
+SETUP_CONSUMERS CREATE TABLE `SETUP_CONSUMERS` (
+ `NAME` varchar(64) NOT NULL,
+ `ENABLED` enum('YES','NO') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
+show create table SETUP_INSTRUMENTS;
+Table Create Table
+SETUP_INSTRUMENTS CREATE TABLE `SETUP_INSTRUMENTS` (
+ `NAME` varchar(128) NOT NULL,
+ `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,
+ `NAME` varchar(128) NOT NULL,
+ `TYPE` varchar(10) NOT NULL,
+ `PROCESSLIST_ID` int(11) DEFAULT NULL,
+ `PROCESSLIST_USER` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_HOST` varchar(60) DEFAULT NULL,
+ `PROCESSLIST_DB` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_COMMAND` varchar(16) DEFAULT NULL,
+ `PROCESSLIST_TIME` bigint(20) DEFAULT NULL,
+ `PROCESSLIST_STATE` varchar(64) DEFAULT NULL,
+ `PROCESSLIST_INFO` longtext,
+ `PARENT_THREAD_ID` int(11) DEFAULT NULL,
+ `ROLE` varchar(64) DEFAULT NULL,
+ `INSTRUMENTED` enum('YES','NO') NOT NULL
+) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== 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-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== modified file 'mysql-test/suite/perfschema/r/start_server_off.result'
--- a/mysql-test/suite/perfschema/r/start_server_off.result 2010-05-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_off.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== modified file 'mysql-test/suite/perfschema/r/start_server_on.result'
--- a/mysql-test/suite/perfschema/r/start_server_on.result 2010-05-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/r/start_server_on.result 2010-05-12 14:04:32 +0000
@@ -30,6 +30,7 @@ select * from performance_schema.FILE_SU
select * from performance_schema.MUTEX_INSTANCES;
select * from performance_schema.PERFORMANCE_TIMERS;
select * from performance_schema.RWLOCK_INSTANCES;
+select * from performance_schema.SETUP_ACTORS;
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_INSTRUMENTS;
select * from performance_schema.SETUP_OBJECTS;
=== added file 'mysql-test/suite/perfschema/t/ddl_setup_actors.test'
--- a/mysql-test/suite/perfschema/t/ddl_setup_actors.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/ddl_setup_actors.test 2010-05-12 14:04:32 +0000
@@ -0,0 +1,45 @@
+# Copyright (c) 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, 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_result '\'setup_actors' '\'SETUP_ACTORS'
+-- error ER_DBACCESS_DENIED_ERROR
+alter table performance_schema.SETUP_ACTORS add column foo integer;
+
+--disable_warnings
+drop table if exists test.SETUP_ACTORS;
+--enable_warnings
+
+create table test.SETUP_ACTORS as
+ select * from performance_schema.SETUP_ACTORS;
+
+truncate table performance_schema.SETUP_ACTORS;
+
+select count(*) from performance_schema.SETUP_ACTORS;
+
+insert into performance_schema.SETUP_ACTORS
+ select * from test.SETUP_ACTORS;
+drop table test.SETUP_ACTORS;
+
+-- error ER_DBACCESS_DENIED_ERROR
+ALTER TABLE performance_schema.SETUP_ACTORS ADD INDEX test_index(HOST);
+
+-- error ER_DBACCESS_DENIED_ERROR
+CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_ACTORS(HOST);
+
=== added file 'mysql-test/suite/perfschema/t/dml_setup_actors.test'
--- a/mysql-test/suite/perfschema/t/dml_setup_actors.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/dml_setup_actors.test 2010-05-12 14:04:32 +0000
@@ -0,0 +1,87 @@
+# Copyright (c) 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, 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
+
+--disable_warnings
+drop table if exists test.SETUP_ACTORS;
+--enable_warnings
+
+# Save the setup
+create table test.SETUP_ACTORS as
+ select * from performance_schema.SETUP_ACTORS;
+truncate table performance_schema.SETUP_ACTORS;
+
+select * from performance_schema.SETUP_ACTORS;
+
+select * from performance_schema.SETUP_ACTORS
+ where user = '%';
+
+insert into performance_schema.SETUP_ACTORS
+ set user='Joe', host='localhost';
+
+insert into performance_schema.SETUP_ACTORS
+ set user='Joe', host='%';
+
+insert into performance_schema.SETUP_ACTORS
+ set user='%', host='server1';
+
+insert into performance_schema.SETUP_ACTORS
+ set user='%', host='%';
+
+select * from performance_schema.SETUP_ACTORS
+ order by USER, HOST;
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.SETUP_ACTORS
+ set user='ILLEGAL';
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.SETUP_ACTORS
+ set host='ILLEGAL';
+
+--error ER_WRONG_PERFSCHEMA_USAGE
+update performance_schema.SETUP_ACTORS
+ set role='ILLEGAL';
+
+select * from performance_schema.SETUP_ACTORS
+ order by USER, HOST;
+
+delete from performance_schema.SETUP_ACTORS
+ where user = 'Joe' and host = 'localhost';
+
+select * from performance_schema.SETUP_ACTORS
+ order by USER, HOST;
+
+delete from performance_schema.SETUP_ACTORS;
+
+select * from performance_schema.SETUP_ACTORS
+ order by USER, HOST;
+
+LOCK TABLES performance_schema.SETUP_ACTORS READ;
+UNLOCK TABLES;
+
+LOCK TABLES performance_schema.SETUP_ACTORS WRITE;
+UNLOCK TABLES;
+
+# Restore the setup
+truncate table performance_schema.SETUP_ACTORS;
+insert into performance_schema.SETUP_ACTORS
+ select * from test.SETUP_ACTORS;
+drop table test.SETUP_ACTORS;
+
=== removed file 'mysql-test/suite/perfschema/t/schema.test'
--- a/mysql-test/suite/perfschema/t/schema.test 2010-05-11 10:36:37 +0000
+++ b/mysql-test/suite/perfschema/t/schema.test 1970-01-01 00:00:00 +0000
@@ -1,46 +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, 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
---source include/have_lowercase0.inc
-
-show databases;
-
-use performance_schema;
-
-show tables;
-
-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 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 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;
-
=== added file 'mysql-test/suite/perfschema/t/schema_lc0.test'
--- a/mysql-test/suite/perfschema/t/schema_lc0.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/schema_lc0.test 2010-05-12 14:04:32 +0000
@@ -0,0 +1,22 @@
+# 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, 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
+--source include/have_lowercase0.inc
+--source ../include/schema.inc
+
=== added file 'mysql-test/suite/perfschema/t/schema_lc1.test'
--- a/mysql-test/suite/perfschema/t/schema_lc1.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/schema_lc1.test 2010-05-12 14:04:32 +0000
@@ -0,0 +1,22 @@
+# 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, 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
+--source include/have_lowercase1.inc
+--source ../include/schema.inc
+
=== added file 'mysql-test/suite/perfschema/t/schema_lc2.test'
--- a/mysql-test/suite/perfschema/t/schema_lc2.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/perfschema/t/schema_lc2.test 2010-05-12 14:04:32 +0000
@@ -0,0 +1,22 @@
+# 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, 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
+--source include/have_lowercase2.inc
+--source ../include/schema.inc
+
=== modified file 'scripts/mysql_system_tables.sql'
--- a/scripts/mysql_system_tables.sql 2010-05-11 10:36:37 +0000
+++ b/scripts/mysql_system_tables.sql 2010-05-12 14:04:32 +0000
@@ -413,6 +413,23 @@ EXECUTE stmt;
DROP PREPARE stmt;
--
+-- TABLE SETUP_ACTORS
+--
+
+SET @l1="CREATE TABLE performance_schema.SETUP_ACTORS(";
+SET @l2="HOST CHAR(60) collate utf8_bin default '%' not null,";
+SET @l3="USER CHAR(16) collate utf8_bin default '%' not null,";
+SET @l4="ROLE CHAR(16) collate utf8_bin default '%' not null";
+SET @l5=")ENGINE=PERFORMANCE_SCHEMA;";
+
+SET @cmd=concat(@l1,@l2,@l3,@l4,@l5);
+
+SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0');
+PREPARE stmt FROM @str;
+EXECUTE stmt;
+DROP PREPARE stmt;
+
+--
-- TABLE SETUP_CONSUMERS
--
=== modified file 'storage/perfschema/CMakeLists.txt'
--- a/storage/perfschema/CMakeLists.txt 2010-05-11 10:36:37 +0000
+++ b/storage/perfschema/CMakeLists.txt 2010-05-12 14:04:32 +0000
@@ -44,6 +44,7 @@ SET(PERFSCHEMA_SOURCES ha_perfschema.h
table_file_instances.h
table_file_summary.h
table_performance_timers.h
+ table_setup_actors.h
table_setup_consumers.h
table_setup_instruments.h
table_setup_objects.h
@@ -68,6 +69,7 @@ SET(PERFSCHEMA_SOURCES ha_perfschema.h
table_file_instances.cc
table_file_summary.cc
table_performance_timers.cc
+ table_setup_actors.cc
table_setup_consumers.cc
table_setup_instruments.cc
table_setup_objects.cc
=== modified file 'storage/perfschema/Makefile.am'
--- a/storage/perfschema/Makefile.am 2010-05-11 10:36:37 +0000
+++ b/storage/perfschema/Makefile.am 2010-05-12 14:04:32 +0000
@@ -37,7 +37,7 @@ noinst_HEADERS = ha_perfschema.h pfs_eng
pfs_global.h pfs_instr_class.h pfs_instr.h \
pfs_column_types.h pfs_column_values.h \
table_setup_instruments.h table_performance_timers.h \
- table_setup_timers.h \
+ table_setup_actors.h table_setup_timers.h \
table_setup_consumers.h table_events_waits.h \
pfs_events_waits.h pfs_timer.h table_threads.h
table_sync_instances.h \
@@ -51,7 +51,7 @@ PSE_SOURCES = ha_perfschema.cc pfs_engin
pfs_global.cc pfs_instr_class.cc pfs_instr.cc \
pfs_column_values.cc \
table_setup_instruments.cc table_performance_timers.cc \
- table_setup_timers.cc \
+ table_setup_actors.cc table_setup_timers.cc \
table_setup_consumers.cc table_events_waits.cc \
pfs_events_waits.cc pfs_timer.cc table_threads.cc \
table_sync_instances.cc \
=== modified file 'storage/perfschema/pfs_engine_table.cc'
--- a/storage/perfschema/pfs_engine_table.cc 2010-05-11 10:36:37 +0000
+++ b/storage/perfschema/pfs_engine_table.cc 2010-05-12 14:04:32 +0000
@@ -22,6 +22,7 @@
#include "pfs_engine_table.h"
#include "table_events_waits.h"
+#include "table_setup_actors.h"
#include "table_setup_consumers.h"
#include "table_setup_instruments.h"
#include "table_setup_objects.h"
@@ -36,6 +37,8 @@
/* For show status */
#include "pfs_column_values.h"
#include "pfs_instr.h"
+#include "pfs_setup_actor.h"
+#include "pfs_global.h"
#include "sql_base.h" // close_thread_tables
#include "lock.h" // MYSQL_LOCK_IGNORE_TIMEOUT
@@ -50,6 +53,7 @@ static PFS_engine_table_share *all_share
&table_events_waits_current::m_share,
&table_events_waits_history::m_share,
&table_events_waits_history_long::m_share,
+ &table_setup_actors::m_share,
&table_setup_consumers::m_share,
&table_setup_instruments::m_share,
&table_setup_objects::m_share,
@@ -79,7 +83,7 @@ void PFS_engine_table_share::check_all_t
DBUG_EXECUTE_IF("tampered_perfschema_table1",
{
/* Hack SETUP_INSTRUMENT, incompatible change. */
- all_shares[4]->m_field_def->count++;
+ all_shares[5]->m_field_def->count++;
});
for (current= &all_shares[0]; (*current) != NULL; current++)
@@ -804,6 +808,7 @@ bool pfs_show_status(handlerton *hton, T
case 40:
name= "(PFS_FILE_HANDLE).MEMORY";
size= file_handle_max * sizeof(PFS_file*);
+ total_memory+= size;
break;
case 41:
name= "EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME.ROW_SIZE";
@@ -818,11 +823,50 @@ bool pfs_show_status(handlerton *hton, T
size= thread_max * instr_class_per_thread * sizeof(PFS_single_stat_chain);
total_memory+= size;
break;
+ case 44:
+ name= "SETUP_ACTORS.ROW_SIZE";
+ size= sizeof(PFS_setup_actor);
+ break;
+ case 45:
+ name= "SETUP_ACTORS.ROW_COUNT";
+ size= setup_actor_max;
+ break;
+ case 46:
+ name= "SETUP_ACTORS.MEMORY";
+ size= setup_actor_max * sizeof(PFS_setup_actor);
+ total_memory+= size;
+ break;
+ case 47:
+ name= "(PFS_TABLE_SHARE).ROW_SIZE";
+ size= sizeof(PFS_table_share);
+ break;
+ case 48:
+ name= "(PFS_TABLE_SHARE).ROW_COUNT";
+ size= table_share_max;
+ break;
+ case 49:
+ name= "(PFS_TABLE_SHARE).MEMORY";
+ size= table_share_max * sizeof(PFS_table_share);
+ total_memory+= size;
+ break;
+ case 50:
+ name= "(PFS_TABLE).ROW_SIZE";
+ size= sizeof(PFS_table);
+ break;
+ case 51:
+ name= "(PFS_TABLE).ROW_COUNT";
+ size= table_max;
+ break;
+ case 52:
+ name= "(PFS_TABLE).MEMORY";
+ size= table_max * sizeof(PFS_table);
+ total_memory+= size;
+ break;
/*
This case must be last,
for aggregation in total_memory.
*/
- case 44:
+ case 53:
name= "PERFORMANCE_SCHEMA.MEMORY";
size= total_memory;
break;
@@ -845,4 +889,3 @@ end:
/** @} */
-
=== added file 'storage/perfschema/table_setup_actors.cc'
--- a/storage/perfschema/table_setup_actors.cc 1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_setup_actors.cc 2010-05-12 14:04:32 +0000
@@ -0,0 +1,292 @@
+/* Copyright (c) 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, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+/**
+ @file storage/perfschema/table_setup_actors.cc
+ Table SETUP_ACTORS (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 "pfs_setup_actor.h"
+#include "table_setup_actors.h"
+#include "pfs_global.h"
+
+THR_LOCK table_setup_actors::m_table_lock;
+
+static const TABLE_FIELD_TYPE field_types[]=
+{
+ {
+ { C_STRING_WITH_LEN("HOST") },
+ { C_STRING_WITH_LEN("char(60)") },
+ { NULL, 0}
+ },
+ {
+ { C_STRING_WITH_LEN("USER") },
+ { C_STRING_WITH_LEN("char(16)") },
+ { NULL, 0}
+ },
+ {
+ { C_STRING_WITH_LEN("ROLE") },
+ { C_STRING_WITH_LEN("char(16)") },
+ { NULL, 0}
+ }
+};
+
+TABLE_FIELD_DEF
+table_setup_actors::m_field_def=
+{ 3, field_types };
+
+PFS_engine_table_share
+table_setup_actors::m_share=
+{
+ { C_STRING_WITH_LEN("SETUP_ACTORS") },
+ &pfs_editable_acl,
+ table_setup_actors::create,
+ table_setup_actors::write_row,
+ table_setup_actors::delete_all_rows,
+ table_setup_actors::get_row_count,
+ 1000, /* records */
+ sizeof(PFS_simple_index),
+ &m_table_lock,
+ &m_field_def,
+ false /* checked */
+};
+
+PFS_engine_table* table_setup_actors::create()
+{
+ return new table_setup_actors();
+}
+
+int table_setup_actors::write_row(TABLE *table, unsigned char *buf,
+ Field **fields)
+{
+ Field *f;
+ String user_data("%", 1, &my_charset_utf8_bin);
+ String host_data("%", 1, &my_charset_utf8_bin);
+ String role_data("%", 1, &my_charset_utf8_bin);
+ String *user= &user_data;
+ String *host= &host_data;
+ String *role= &role_data;
+
+ for (; (f= *fields) ; fields++)
+ {
+ if (bitmap_is_set(table->write_set, f->field_index))
+ {
+ switch(f->field_index)
+ {
+ case 0: /* HOST */
+ host= get_field_char_utf8(f, &host_data);
+ break;
+ case 1: /* USER */
+ user= get_field_char_utf8(f, &user_data);
+ break;
+ case 2: /* ROLE */
+ role= get_field_char_utf8(f, &role_data);
+ break;
+ default:
+ DBUG_ASSERT(false);
+ }
+ }
+ }
+
+ return insert_setup_actor(user, host, role);
+}
+
+int table_setup_actors::delete_all_rows(void)
+{
+ return reset_setup_actor();
+}
+
+ha_rows table_setup_actors::get_row_count(void)
+{
+ return setup_actor_count();
+}
+
+table_setup_actors::table_setup_actors()
+ : PFS_engine_table(&m_share, &m_pos),
+ m_row_exists(false), m_pos(0), m_next_pos(0)
+{}
+
+void table_setup_actors::reset_position(void)
+{
+ m_pos.m_index= 0;
+ m_next_pos.m_index= 0;
+}
+
+int table_setup_actors::rnd_next()
+{
+ PFS_setup_actor *pfs;
+
+ for (m_pos.set_at(&m_next_pos);
+ m_pos.m_index < setup_actor_max;
+ m_pos.next())
+ {
+ pfs= &setup_actor_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_setup_actors::rnd_pos(const void *pos)
+{
+ PFS_setup_actor *pfs;
+
+ set_position(pos);
+
+ DBUG_ASSERT(m_pos.m_index < setup_actor_max);
+ pfs= &setup_actor_array[m_pos.m_index];
+ if (pfs->m_lock.is_populated())
+ {
+ make_row(pfs);
+ return 0;
+ }
+
+ return HA_ERR_RECORD_DELETED;
+}
+
+void table_setup_actors::make_row(PFS_setup_actor *pfs)
+{
+ pfs_lock lock;
+
+ m_row_exists= false;
+
+ pfs->m_lock.begin_optimistic_lock(&lock);
+
+ memcpy(m_row.m_hostname, pfs->m_hostname, pfs->m_hostname_length);
+ m_row.m_hostname_length= pfs->m_hostname_length;
+ memcpy(m_row.m_username, pfs->m_username, pfs->m_username_length);
+ m_row.m_username_length= pfs->m_username_length;
+ memcpy(m_row.m_rolename, pfs->m_rolename, pfs->m_rolename_length);
+ m_row.m_rolename_length= pfs->m_rolename_length;
+
+ if (pfs->m_lock.end_optimistic_lock(&lock))
+ m_row_exists= true;
+}
+
+int table_setup_actors::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);
+
+ for (; (f= *fields) ; fields++)
+ {
+ if (read_all || bitmap_is_set(table->read_set, f->field_index))
+ {
+ switch(f->field_index)
+ {
+ case 0: /* HOST */
+ set_field_char_utf8(f, m_row.m_hostname, m_row.m_hostname_length);
+ break;
+ case 1: /* USER */
+ set_field_char_utf8(f, m_row.m_username, m_row.m_username_length);
+ break;
+ case 2: /* ROLE */
+ set_field_char_utf8(f, m_row.m_rolename, m_row.m_rolename_length);
+ break;
+ default:
+ DBUG_ASSERT(false);
+ }
+ }
+ }
+
+ return 0;
+}
+
+int table_setup_actors::update_row_values(TABLE *table,
+ const unsigned char *old_buf,
+ unsigned char *new_buf,
+ Field **fields)
+{
+ Field *f;
+
+ for (; (f= *fields) ; fields++)
+ {
+ if (bitmap_is_set(table->write_set, f->field_index))
+ {
+ switch(f->field_index)
+ {
+ case 0: /* HOST */
+ case 1: /* USER */
+ case 2: /* ROLE */
+ my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0));
+ return HA_ERR_WRONG_COMMAND;
+ break;
+ default:
+ DBUG_ASSERT(false);
+ }
+ }
+ }
+
+ return 0;
+}
+
+int table_setup_actors::delete_row_values(TABLE *table,
+ const unsigned char *buf,
+ Field **fields)
+{
+ Field *f;
+ String user_data("", 0, &my_charset_utf8_bin);
+ String host_data("", 0, &my_charset_utf8_bin);
+ String role_data("", 0, &my_charset_utf8_bin);
+ String *user= NULL;
+ String *host= NULL;
+ String *role= NULL;
+
+ for (; (f= *fields) ; fields++)
+ {
+ if (bitmap_is_set(table->read_set, f->field_index))
+ {
+ switch(f->field_index)
+ {
+ case 0: /* HOST */
+ host= get_field_char_utf8(f, &host_data);
+ break;
+ case 1: /* USER */
+ user= get_field_char_utf8(f, &user_data);
+ break;
+ case 2: /* ROLE */
+ role= get_field_char_utf8(f, &role_data);
+ break;
+ default:
+ DBUG_ASSERT(false);
+ }
+ }
+ }
+
+ DBUG_ASSERT(user != NULL);
+ DBUG_ASSERT(host != NULL);
+ DBUG_ASSERT(role != NULL);
+
+ return delete_setup_actor(user, host, role);
+}
+
=== added file 'storage/perfschema/table_setup_actors.h'
--- a/storage/perfschema/table_setup_actors.h 1970-01-01 00:00:00 +0000
+++ b/storage/perfschema/table_setup_actors.h 2010-05-12 14:04:32 +0000
@@ -0,0 +1,106 @@
+/* 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, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef TABLE_SETUP_ACTORS_H
+#define TABLE_SETUP_ACTORS_H
+
+/**
+ @file storage/perfschema/table_setup_actors.h
+ Table SETUP_ACTORS (declarations).
+*/
+
+#include "pfs_engine_table.h"
+
+struct PFS_setup_actor;
+
+/**
+ @addtogroup Performance_schema_tables
+ @{
+*/
+
+/** A row of PERFORMANCE_SCHEMA.SETUP_ACTORS. */
+struct row_setup_actors
+{
+ /** Column HOST. */
+ char m_hostname[HOSTNAME_LENGTH];
+ /** Length in bytes of @c m_hostname. */
+ uint m_hostname_length;
+ /** Column USER. */
+ char m_username[USERNAME_LENGTH];
+ /** Length in bytes of @c m_username. */
+ uint m_username_length;
+ /** Column ROLE. */
+ char m_rolename[16];
+ /** Length in bytes of @c m_rolename. */
+ uint m_rolename_length;
+};
+
+/** Table PERFORMANCE_SCHEMA.SETUP_ACTORS. */
+class table_setup_actors : public PFS_engine_table
+{
+public:
+ /** Table share. */
+ static PFS_engine_table_share m_share;
+ /** Table builder. */
+ static PFS_engine_table* create();
+ static int write_row(TABLE *table, unsigned char *buf, Field **fields);
+ static int delete_all_rows();
+ static ha_rows get_row_count();
+
+ 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);
+
+ virtual int delete_row_values(TABLE *table,
+ const unsigned char *buf,
+ Field **fields);
+
+ table_setup_actors();
+
+public:
+ ~table_setup_actors()
+ {}
+
+private:
+ void make_row(PFS_setup_actor *actor);
+
+ /** Table share lock. */
+ static THR_LOCK m_table_lock;
+ /** Fields definition. */
+ static TABLE_FIELD_DEF m_field_def;
+
+ /** Current row. */
+ row_setup_actors 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-20100512140432-o2sm33hblkzb2zbn.bundle
| Thread |
|---|
| • bzr commit into mysql-next-mr branch (marc.alff:3144) WL#4674 | Marc Alff | 12 May |