1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

WL#2360 Performance schema

Part V: performance schema implementation
This commit is contained in:
Marc Alff
2010-01-11 18:47:27 -07:00
parent a4c3bc618b
commit 67a48e1a4c
285 changed files with 27090 additions and 629 deletions

View File

@@ -0,0 +1,187 @@
# 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
# Verify that statistics aggregated by different criteria are consistent.
--source include/not_embedded.inc
--source include/have_perfschema.inc
--echo "General cleanup"
--disable_warnings
drop table if exists t1;
--enable_warnings
update performance_schema.SETUP_INSTRUMENTS set enabled = 'NO';
update performance_schema.SETUP_CONSUMERS set enabled = 'NO';
# 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_BY_INSTANCE;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
# Start recording data
update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
update performance_schema.SETUP_INSTRUMENTS
set enabled = 'YES', timed = 'YES';
create table t1 (
id INT PRIMARY KEY,
b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8);
# Stop recording data, so the select below don't add noise.
update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO';
# Helper to debug
set @dump_all=FALSE;
# Note that in general:
# - COUNT/SUM/MAX(FILE_SUMMARY_BY_EVENT_NAME) >=
# COUNT/SUM/MAX(FILE_SUMMARY_BY_INSTANCE).
# - MIN(FILE_SUMMARY_BY_EVENT_NAME) <=
# MIN(FILE_SUMMARY_BY_INSTANCE).
# There will be equality only when file instances are not removed,
# aka when a file is not deleted from the file system,
# 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_BY_INSTANCE)
# - MIN(EVENTS_WAITS_SUMMARY_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
# in the server.
# For example, a MyISAM table removed from the table cache
# will cause a mysql_mutex_destroy on myisam/MYISAM_SHARE::intern_lock.
# Another example, a thread terminating will cause a mysql_mutex_destroy
# on sql/LOCK_delete
# 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_BY_THREAD_BY_EVENT_NAME)
# - MIN(EVENTS_WAITS_SUMMARY_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
# delayed) ever completes.
# A thread completing will cause rows in
# EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME to be removed.
--echo "Verifying file aggregate consistency"
# Since the code generating the load in this test does:
# - create table
# - insert
# - does not cause temporary tables to be used
# we can test for equality here for file aggregates.
# If any of these queries returns data, the test failed.
SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_READ <> SUM(i.COUNT_READ))
OR @dump_all;
SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ))
OR @dump_all;
SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE)
FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e
JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE))
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
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
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))
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
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))
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
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.SUM_TIMER_WAIT <> SUM(t.SUM_TIMER_WAIT))
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
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MIN_TIMER_WAIT <> MIN(t.MIN_TIMER_WAIT))
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
JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t
USING (EVENT_NAME)
GROUP BY EVENT_NAME
HAVING (e.MAX_TIMER_WAIT <> MAX(t.MAX_TIMER_WAIT))
OR @dump_all;
# Cleanup
update performance_schema.SETUP_CONSUMERS set enabled = 'YES';
update performance_schema.SETUP_INSTRUMENTS
set enabled = 'YES', timed = 'YES';
drop table test.t1;

View File

@@ -0,0 +1,45 @@
# 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
# Check error handling for invalid server start options
--source include/not_embedded.inc
--source include/have_perfschema.inc
--error 7
--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-enabled=maybe > $MYSQLTEST_VARDIR/tmp/bad_option_1.txt 2>&1
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_1.txt";
open(FILE, "<", $fname) or die;
my @lines= <FILE>;
# those must be in the file for the test to pass
my @patterns=
("unknown variable 'performance-schema-enabled=maybe'",
"Aborting");
foreach my $one_line (@lines)
{
foreach my $one_pattern (@patterns)
{
# print pattern, not line, to get a stable output
print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
}
}
close FILE;
EOF

View File

@@ -0,0 +1,44 @@
# 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
# Check error handling for ambiguous server start options
--source include/not_embedded.inc
--source include/have_perfschema.inc
--error 3
--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $MYSQLTEST_VARDIR/tmp/bad_option_2.txt 2>&1
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_2.txt";
open(FILE, "<", $fname) or die;
my @lines= <FILE>;
# those must be in the file for the test to pass
my @patterns=
("ambiguous option '--performance-schema-max_=12'");
foreach my $one_line (@lines)
{
foreach my $one_pattern (@patterns)
{
# print pattern, not line, to get a stable output
print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/);
}
}
close FILE;
EOF

View File

@@ -0,0 +1,28 @@
# 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/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
# See Bug#46896 binlog: case sensitivity of table names
--source include/have_lowercase0.inc
set binlog_format=mixed;
--source ../include/binlog_common.inc

View File

@@ -0,0 +1,28 @@
# 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/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
# See Bug#46896 binlog: case sensitivity of table names
--source include/have_lowercase0.inc
set binlog_format=row;
--source ../include/binlog_common.inc

View File

@@ -0,0 +1,25 @@
# 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/have_log_bin.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
set binlog_format=statement;
--source ../include/binlog_common.inc

View File

@@ -0,0 +1,25 @@
# 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
# Check server start options, read from a .cnf file
# Use default setting for mysqld processes
!include include/default_mysqld.cnf
[mysqld.1]
loose-performance-schema-max-thread_instances=318
loose-performance-schema-max-thread_classes=12

View File

@@ -0,0 +1,24 @@
# 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
# Check server start options, read from a .cnf file
--source include/not_embedded.inc
--source include/have_perfschema.inc
show variables like 'performance_schema_max_thread_classes';
show variables like 'performance_schema_max_thread_instances';

View File

@@ -0,0 +1,82 @@
# 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
# Test how columns privileges can be used on performance schema tables,
# for very fine control.
--source include/not_embedded.inc
--source include/have_perfschema.inc
show grants;
grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION;
# Test per column privileges on performance_schema
grant SELECT(thread_id, event_id) on performance_schema.EVENTS_WAITS_CURRENT
to 'pfs_user_5'@localhost;
grant UPDATE(enabled) on performance_schema.SETUP_INSTRUMENTS
to 'pfs_user_5'@localhost;
flush privileges;
connect (con1, localhost, pfs_user_5, , );
# Commented because the result is not consistent (uppercase/lowercase)
# show grants;
# For statements that works, we do not look at the output
--disable_result_log
select thread_id from performance_schema.EVENTS_WAITS_CURRENT;
select thread_id, event_id from performance_schema.EVENTS_WAITS_CURRENT;
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
--enable_result_log
# For statements that are denied, check the error number and error text.
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_COLUMNACCESS_DENIED_ERROR
select event_name from performance_schema.EVENTS_WAITS_CURRENT;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_COLUMNACCESS_DENIED_ERROR
select thread_id, event_id, event_name
from performance_schema.EVENTS_WAITS_CURRENT;
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_COLUMNACCESS_DENIED_ERROR
update performance_schema.SETUP_INSTRUMENTS set name='illegal';
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_COLUMNACCESS_DENIED_ERROR
update performance_schema.SETUP_INSTRUMENTS set timed='NO';
# Cleanup
--connection default
--disconnect con1
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost;
flush privileges;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE';

View File

@@ -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.COND_INSTANCES add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.COND_INSTANCES;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.COND_INSTANCES ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.COND_INSTANCES(NAME);

View File

@@ -0,0 +1,31 @@
# 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_CURRENT add column foo integer;
truncate table performance_schema.EVENTS_WAITS_CURRENT;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.EVENTS_WAITS_CURRENT ADD INDEX test_index(EVENT_ID);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_CURRENT(EVENT_ID);

View File

@@ -0,0 +1,31 @@
# 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_HISTORY add column foo integer;
truncate table performance_schema.EVENTS_WAITS_HISTORY;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY ADD INDEX test_index(EVENT_ID);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY(EVENT_ID);

View File

@@ -0,0 +1,31 @@
# 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_HISTORY_LONG add column foo integer;
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG ADD INDEX test_index(EVENT_ID);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY_LONG(EVENT_ID);

View File

@@ -0,0 +1,31 @@
# 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_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);

View File

@@ -0,0 +1,31 @@
# 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_BY_INSTANCE add column foo integer;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE ADD INDEX test_index(EVENT_NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE(EVENT_NAME);

View File

@@ -0,0 +1,33 @@
# 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_BY_THREAD_BY_EVENT_NAME
add column foo integer;
truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME ADD INDEX test_index(THREAD_ID);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index
ON performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME(THREAD_ID);

View File

@@ -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.FILE_INSTANCES add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.FILE_INSTANCES;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.FILE_INSTANCES ADD INDEX test_index(FILE_NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.FILE_INSTANCES(FILE_NAME);

View File

@@ -0,0 +1,31 @@
# 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.FILE_SUMMARY_BY_EVENT_NAME add column foo integer;
truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_EVENT_NAME(NAME);

View File

@@ -0,0 +1,31 @@
# 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.FILE_SUMMARY_BY_INSTANCE add column foo integer;
truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_INSTANCE(NAME);

View File

@@ -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.MUTEX_INSTANCES add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.MUTEX_INSTANCES;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.MUTEX_INSTANCES ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.MUTEX_INSTANCES(NAME);

View File

@@ -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.PERFORMANCE_TIMERS add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.PERFORMANCE_TIMERS;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.PERFORMANCE_TIMERS ADD INDEX test_index(TIMER_NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.PERFORMANCE_TIMERS(TIMER_NAME);

View File

@@ -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.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);

View File

@@ -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.RWLOCK_INSTANCES add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.RWLOCK_INSTANCES;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.RWLOCK_INSTANCES ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.RWLOCK_INSTANCES(NAME);

View File

@@ -0,0 +1,33 @@
# 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
--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
-- error ER_DBACCESS_DENIED_ERROR
alter table performance_schema.SETUP_CONSUMERS add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.SETUP_CONSUMERS;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.SETUP_CONSUMERS ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_CONSUMERS(NAME);

View File

@@ -0,0 +1,33 @@
# 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
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
-- error ER_DBACCESS_DENIED_ERROR
alter table performance_schema.SETUP_INSTRUMENTS add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.SETUP_INSTRUMENTS;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.SETUP_INSTRUMENTS ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_INSTRUMENTS(NAME);

View File

@@ -0,0 +1,32 @@
# 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_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);

View File

@@ -0,0 +1,33 @@
# 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
--replace_result '\'setup_timers' '\'SETUP_TIMERS'
-- error ER_DBACCESS_DENIED_ERROR
alter table performance_schema.SETUP_TIMERS add column foo integer;
-- error ER_WRONG_PERFSCHEMA_USAGE
truncate table performance_schema.SETUP_TIMERS;
-- error ER_DBACCESS_DENIED_ERROR
ALTER TABLE performance_schema.SETUP_TIMERS ADD INDEX test_index(NAME);
-- error ER_DBACCESS_DENIED_ERROR
CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_TIMERS(NAME);

View File

@@ -0,0 +1,27 @@
# 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
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################

View File

@@ -0,0 +1,55 @@
# 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
--replace_column 1 # 2 #
select * from performance_schema.COND_INSTANCES limit 1;
select * from performance_schema.COND_INSTANCES
where name='FOO';
--replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.COND_INSTANCES
set name='FOO', object_instance_begin=12;
--replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.COND_INSTANCES
set name='FOO';
--replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.COND_INSTANCES
where name like "wait/%";
--replace_result '\'cond_instances' '\'COND_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.COND_INSTANCES;
--replace_result '\'cond_instances' '\'COND_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.COND_INSTANCES READ;
UNLOCK TABLES;
--replace_result '\'cond_instances' '\'COND_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.COND_INSTANCES WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,62 @@
# 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
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.EVENTS_WAITS_CURRENT
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.EVENTS_WAITS_CURRENT
where event_name='FOO';
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.EVENTS_WAITS_CURRENT
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_CURRENT
set timer_start=12;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_CURRENT
set timer_start=12 where thread_id=0;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_CURRENT
where thread_id=1;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_CURRENT;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT READ;
UNLOCK TABLES;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,70 @@
# 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
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name='FOO';
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.EVENTS_WAITS_HISTORY
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.EVENTS_WAITS_HISTORY
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_HISTORY
set timer_start=12;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_HISTORY
set timer_start=12 where thread_id=0;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_HISTORY
where thread_id=1;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_HISTORY;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY READ;
UNLOCK TABLES;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,70 @@
# 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
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name='FOO';
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name like 'Wait/Synch/%' order by timer_wait limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 #
select * from performance_schema.EVENTS_WAITS_HISTORY_LONG
where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.EVENTS_WAITS_HISTORY_LONG
set thread_id='1', event_id=1,
event_name='FOO', timer_start=1, timer_end=2, timer_wait=3;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_HISTORY_LONG
set timer_start=12;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_HISTORY_LONG
set timer_start=12 where thread_id=0;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_HISTORY_LONG
where thread_id=1;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_HISTORY_LONG;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG READ;
UNLOCK TABLES;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG WRITE;
UNLOCK TABLES;

View File

@@ -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_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;

View File

@@ -0,0 +1,79 @@
# 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 # 7 #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where event_name='FOO';
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
order by count_star limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
order by count_star desc limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where min_timer_wait > 0 order by count_star limit 1;
--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where min_timer_wait > 0 order by count_star desc limit 1;
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
set event_name='FOO', object_instance_begin=0,
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_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
set count_star=12;
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
set count_star=12 where event_name like "FOO";
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE
where count_star=1;
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE READ;
UNLOCK TABLES;
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,63 @@
# 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 # 7 #
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
where event_name like 'Wait/Synch/%' limit 1;
select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
where event_name='FOO';
--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
set event_name='FOO', thread_id=1,
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_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
set count_star=12;
--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
set count_star=12 where event_name like "FOO";
--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME
where count_star=1;
--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME;
--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME READ;
UNLOCK TABLES;
--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,55 @@
# 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.FILE_INSTANCES limit 1;
select * from performance_schema.FILE_INSTANCES
where file_name='FOO';
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.FILE_INSTANCES
set file_name='FOO', event_name='BAR', open_count=12;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.FILE_INSTANCES
set file_name='FOO';
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.FILE_INSTANCES
where event_name like "wait/%";
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.FILE_INSTANCES;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.FILE_INSTANCES READ;
UNLOCK TABLES;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.FILE_INSTANCES WRITE;
UNLOCK TABLES;

View File

@@ -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 #
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
where event_name like 'Wait/io/%' limit 1;
select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
where event_name='FOO';
--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.FILE_SUMMARY_BY_EVENT_NAME
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
set count_read=12;
--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.FILE_SUMMARY_BY_EVENT_NAME
set count_write=12 where event_name like "FOO";
--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME
where count_read=1;
--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME;
--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME READ;
UNLOCK TABLES;
--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME WRITE;
UNLOCK TABLES;

View File

@@ -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.FILE_SUMMARY_BY_INSTANCE
where event_name like 'Wait/io/%' limit 1;
select * from performance_schema.FILE_SUMMARY_BY_INSTANCE
where event_name='FOO';
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.FILE_SUMMARY_BY_INSTANCE
set event_name='FOO', count_read=1, count_write=2,
sum_number_of_bytes_read=4, sum_number_of_bytes_write=5;
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.FILE_SUMMARY_BY_INSTANCE
set count_read=12;
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.FILE_SUMMARY_BY_INSTANCE
set count_write=12 where event_name like "FOO";
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.FILE_SUMMARY_BY_INSTANCE
where count_read=1;
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.FILE_SUMMARY_BY_INSTANCE;
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE READ;
UNLOCK TABLES;
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,55 @@
# 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
--replace_column 1 # 2 #
select * from performance_schema.MUTEX_INSTANCES limit 1;
select * from performance_schema.MUTEX_INSTANCES
where name='FOO';
--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.MUTEX_INSTANCES
set name='FOO', object_instance_begin=12;
--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.MUTEX_INSTANCES
set name='FOO';
--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.MUTEX_INSTANCES
where name like "wait/%";
--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.MUTEX_INSTANCES;
--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.MUTEX_INSTANCES READ;
UNLOCK TABLES;
--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.MUTEX_INSTANCES WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,57 @@
# 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
--replace_column 2 <frequency> 3 <resolution> 4 <overhead>
select * from performance_schema.PERFORMANCE_TIMERS;
--replace_column 2 <frequency> 3 <resolution> 4 <overhead>
select * from performance_schema.PERFORMANCE_TIMERS
where timer_name='CYCLE';
--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.PERFORMANCE_TIMERS
set timer_name='FOO', timer_frequency=1,
timer_resolution=2, timer_overhead=3;
--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.PERFORMANCE_TIMERS
set timer_frequency=12 where timer_name='CYCLE';
--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.PERFORMANCE_TIMERS;
--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.PERFORMANCE_TIMERS
where timer_name='CYCLE';
--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.PERFORMANCE_TIMERS READ;
UNLOCK TABLES;
--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.PERFORMANCE_TIMERS WRITE;
UNLOCK TABLES;

View File

@@ -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.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;

View File

@@ -0,0 +1,55 @@
# 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
--replace_column 1 # 2 #
select * from performance_schema.RWLOCK_INSTANCES limit 1;
select * from performance_schema.RWLOCK_INSTANCES
where name='FOO';
--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.RWLOCK_INSTANCES
set name='FOO', object_instance_begin=12;
--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.RWLOCK_INSTANCES
set name='FOO';
--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.RWLOCK_INSTANCES
where name like "wait/%";
--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.RWLOCK_INSTANCES;
--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.RWLOCK_INSTANCES READ;
UNLOCK TABLES;
--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES'
-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.RWLOCK_INSTANCES WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,59 @@
# 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
select * from performance_schema.SETUP_CONSUMERS;
select * from performance_schema.SETUP_CONSUMERS
where name='events_waits_current';
select * from performance_schema.SETUP_CONSUMERS
where enabled='YES';
select * from performance_schema.SETUP_CONSUMERS
where enabled='NO';
--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.SETUP_CONSUMERS
set name='FOO', enabled='YES';
--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.SETUP_CONSUMERS
set name='FOO';
update performance_schema.SETUP_CONSUMERS
set enabled='YES';
--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.SETUP_CONSUMERS;
--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.SETUP_CONSUMERS
where name='events_waits_current';
LOCK TABLES performance_schema.SETUP_CONSUMERS READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.SETUP_CONSUMERS WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,100 @@
# 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
# The query result are not re producible,
# due to variations in platforms and plugins
# We still execute the select statement, for:
# - code coverage
# - make sure it does not crash
# - valgrind coverage
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS;
--enable_result_log
# DEBUG_SYNC::mutex is dependent on the build (DEBUG only)
select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Mutex/sql/%'
and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
order by name limit 10;
select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Rwlock/sql/%'
order by name limit 10;
# COND_handler_count is dependent on the build (Windows only)
# DEBUG_SYNC::cond is dependent on the build (DEBUG only)
select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Cond/sql/%'
and name not in (
'wait/synch/cond/sql/COND_handler_count',
'wait/synch/cond/sql/DEBUG_SYNC::cond')
order by name limit 10;
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS
where name='Wait';
--enable_result_log
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS
where enabled='YES';
--enable_result_log
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.SETUP_INSTRUMENTS
set name='FOO', enabled='YES', timed='YES';
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.SETUP_INSTRUMENTS
set name='FOO';
update performance_schema.SETUP_INSTRUMENTS
set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS
set timed='NO';
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS;
--enable_result_log
update performance_schema.SETUP_INSTRUMENTS
set enabled='YES', timed='YES';
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.SETUP_INSTRUMENTS;
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/%';
LOCK TABLES performance_schema.SETUP_INSTRUMENTS READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.SETUP_INSTRUMENTS WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,75 @@
# 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
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;

View File

@@ -0,0 +1,61 @@
# 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
select * from performance_schema.SETUP_TIMERS;
select * from performance_schema.SETUP_TIMERS
where name='Wait';
select * from performance_schema.SETUP_TIMERS
where timer_name='CYCLE';
--replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.SETUP_TIMERS
set name='FOO', timer_name='CYCLE';
--replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.SETUP_TIMERS
set name='FOO';
update performance_schema.SETUP_TIMERS
set timer_name='MILLISECOND';
select * from performance_schema.SETUP_TIMERS;
update performance_schema.SETUP_TIMERS
set timer_name='CYCLE';
--replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.SETUP_TIMERS;
--replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.SETUP_TIMERS
where name='Wait';
LOCK TABLES performance_schema.SETUP_TIMERS READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.SETUP_TIMERS WRITE;
UNLOCK TABLES;

View File

@@ -0,0 +1,192 @@
# 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
##
## WL#4814, 4.1.4 FILE IO
##
## Functional testing of File IO
##
--source include/not_embedded.inc
--source include/have_perfschema.inc
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# TODO: Change to InnoDB when it gets instrumentation
#
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
#
# FF1: Count for file should increase with instrumentation enabled and
# FF2: Count for file should not increase with instrumentation disabled
#
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD'));
SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation;
SELECT * FROM t1 WHERE id < 4;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled='NO';
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2));
SELECT * FROM t1 WHERE id < 6;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile')
AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed;
#
# Check not timed measurements
#
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/io/file/%';
UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'NO';
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id > 4;
SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT
WHERE TIMER_WAIT != NULL
OR TIMER_START != NULL
OR TIMER_END != NULL;
UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'YES';
SELECT * FROM t1 WHERE id < 4;
DROP TABLE t1;
#
# FF4: Use-case from Enterprise Monitor
#
--disable_result_log
SELECT SUM(COUNT_READ) AS sum_count_read,
SUM(COUNT_WRITE) AS sum_count_write,
SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read,
SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write
FROM performance_schema.FILE_SUMMARY_BY_INSTANCE
WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL;
--enable_result_log
#
# FF5: Troubleshooting tasks
#
# These queries will give different results based on timing,
# but at least they should not crash.
#
#
# Total and average wait time for different events on system level
#
--disable_result_log
SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT
FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME
WHERE COUNT_STAR > 0
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 10;
--enable_result_log
#
# Total and average wait time for different users
#
--disable_result_log
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)
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
GROUP BY i.user
ORDER BY SUM_WAIT DESC
LIMIT 20;
--enable_result_log
#
# Total and average wait times for different events for a session
#
--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)
WHERE p.ID = 1
GROUP BY h.EVENT_NAME
HAVING TOTAL_WAIT > 0;
--enable_result_log
#
# Which user reads and writes data
#
--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)
LEFT JOIN information_schema.PROCESSLIST i USING (ID)
GROUP BY i.user, h.operation
HAVING BYTES > 0
ORDER BY i.user, h.operation;
--enable_result_log

View File

@@ -0,0 +1,131 @@
# 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
##
## WL#4818, 4.1.3 MUTEXES, RW-LOCKS, ...
##
## Functional testing of mutexes and RW-locks
##
--source include/not_embedded.inc
--source include/have_perfschema.inc
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
#
# TODO: Change to InnoDB when it gets instrumentation
#
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
#
# FM1: Count for mutex should increase with instrumentation enabled and
# FM2: Count for mutex should not increase with instrumentation disabled
#
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
WHERE NAME = 'wait/synch/mutex/sql/LOCK_open';
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed;
#
# Repeat for RW-lock
#
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'
WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant';
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
SELECT * FROM t1 WHERE id = 1;
SET @before_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT * FROM t1;
SET @after_count = (SELECT SUM(TIMER_WAIT)
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant'));
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed;
DROP TABLE t1;

View File

@@ -0,0 +1,90 @@
# 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
#
# Test the effect of a flush tables with read lock on SETUP_ tables.
--source include/not_embedded.inc
--source include/have_perfschema.inc
use performance_schema;
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
--echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);
lock tables performance_schema.SETUP_INSTRUMENTS read;
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS;
--enable_result_log
unlock tables;
lock tables performance_schema.SETUP_INSTRUMENTS write;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
unlock tables;
--echo connection default;
connection default;
flush tables with read lock;
--echo connection con1;
connection con1;
lock tables performance_schema.SETUP_INSTRUMENTS read;
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS;
--enable_result_log
unlock tables;
# This will block
--send
lock tables performance_schema.SETUP_INSTRUMENTS write;
--echo connection default;
connection default;
let $wait_condition= select 1 from performance_schema.EVENTS_WAITS_CURRENT where event_name like "wait/synch/cond/sql/COND_global_read_lock";
--source include/wait_condition.inc
# Observe the blocked thread in the performance schema :)
select event_name,
left(source, locate(":", source)) as short_source,
timer_end, timer_wait, operation
from performance_schema.EVENTS_WAITS_CURRENT
where event_name like "wait/synch/cond/sql/COND_global_read_lock";
unlock tables;
connection con1;
--reap
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
unlock tables;
disconnect con1;
--echo connection default;
connection default;
drop user pfsuser@localhost;
flush privileges;

View File

@@ -0,0 +1,67 @@
# 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
# Several selects so the output is readable
# Note that TABLE_NAME is in uppercase is some platforms,
# and in lowercase in others.
# Using upper(TABLE_NAME) to have consistent results.
select TABLE_SCHEMA, upper(TABLE_NAME), TABLE_CATALOG
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), TABLE_TYPE, ENGINE
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), VERSION, ROW_FORMAT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM
from information_schema.tables
where TABLE_SCHEMA='performance_schema';
# TABLESPACE_NAME does not exist in 5.4
# select upper(TABLE_NAME), CREATE_OPTIONS, TABLESPACE_NAME
# from information_schema.tables
# where TABLE_SCHEMA='performance_schema';
select upper(TABLE_NAME), TABLE_COMMENT
from information_schema.tables
where TABLE_SCHEMA='performance_schema';

View File

@@ -0,0 +1,57 @@
# 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
# Miscelaneous
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# Bug#45496 Performance schema: assertion fails in
# ha_perfschema::rnd_init:223
#
--disable_result_log
SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
WHERE THREAD_ID IN
(SELECT THREAD_ID FROM performance_schema.PROCESSLIST)
AND EVENT_NAME IN
(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
--enable_result_log
#
# Bug#45088 Should not be able to create tables of engine PERFORMANCE_SCHEMA
#
--error ER_WRONG_PERFSCHEMA_USAGE
create table test.t1(a int) engine=performance_schema;
#
# Bug#44897 Performance Schema: can create a ghost table in another database
#
--error ER_WRONG_PERFSCHEMA_USAGE
create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT;
#
# Bug#44898 PerformanceSchema: can create a table in db performance_schema, cannot insert
#
--error ER_TABLEACCESS_DENIED_ERROR
create table performance_schema.t1(a int);

View File

@@ -0,0 +1 @@
--performance_schema_events_waits_history_long_size=5000

View File

@@ -0,0 +1,63 @@
# 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
# Setup
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/io/file/myisam/%";
update performance_schema.SETUP_CONSUMERS
set enabled='YES';
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
# Code to test
--disable_warnings
drop table if exists test.no_index_tab;
--enable_warnings
create table test.no_index_tab ( a varchar(255), b int ) engine=myisam;
insert into no_index_tab set a = 'foo', b = 1;
insert into no_index_tab set a = 'foo', b = 1;
insert into no_index_tab set a = 'foo', b = 1;
# Verification
# Note that mi_create.c contains mysql_file_tell() calls in debug only,
# so the result are filtered to remove 'tell'.
select event_name,
left(source, locate(":", source)) as short_source,
operation, number_of_bytes,
substring(object_name, locate("no_index_tab", object_name)) as short_name
from performance_schema.EVENTS_WAITS_HISTORY_LONG
where operation not like "tell"
order by thread_id, event_id;
# In case of failures, this will tell if file io are lost.
show status like 'performance_schema_%';
# Cleanup
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
drop table test.no_index_tab;

View File

@@ -0,0 +1 @@
--one-thread --thread-handling=no-threads --loose-performance-schema-max-thread_instances=10

View File

@@ -0,0 +1,69 @@
# 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
# Setup : in this main thread
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_CONSUMERS set enabled='YES';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
--disable_warnings
drop table if exists test.t1;
--enable_warnings
truncate table performance_schema.EVENTS_WAITS_CURRENT;
truncate table performance_schema.EVENTS_WAITS_HISTORY;
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
show variables like "thread_handling";
# Code to test : in this main thread
create table test.t1(a int) engine=MYISAM;
show variables like "performance_schema";
show variables like "performance_schema_max_thread%";
# Verification : in this main thread
select count(*) from performance_schema.PROCESSLIST
where name like "thread/sql/main";
select count(*) from performance_schema.PROCESSLIST
where name like "thread/sql/OneConnection";
select event_name, operation,
left(source, locate(":", source)) as short_source
from performance_schema.EVENTS_WAITS_CURRENT;
select event_name, operation,
left(source, locate(":", source)) as short_source
from performance_schema.EVENTS_WAITS_HISTORY;
select event_name, operation,
left(source, locate(":", source)) as short_source
from performance_schema.EVENTS_WAITS_HISTORY_LONG;
# Cleanup
drop table test.t1;

View File

@@ -0,0 +1 @@
--thread_handling=one-thread-per-connection

View File

@@ -0,0 +1,94 @@
# 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
# Setup
--source ../include/setup_helper.inc
# We use a myisam table here because CREATE TABLE has a known,
# stable behavior (it will lock THR_LOCK_myisam once).
# The point is not to test myisam, but to test that each
# connection is properly instrumented, with one-thread-per-connection
update performance_schema.SETUP_INSTRUMENTS set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
--disable_warnings
drop table if exists test.t1;
drop table if exists test.t2;
drop table if exists test.t3;
--enable_warnings
truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG;
show variables like "thread_handling";
# Code to test
connection con1;
-- echo "----------------- Connection 1"
create table test.t1(a int) engine=MYISAM;
connection con2;
-- echo "----------------- Connection 2"
create table test.t2(a int) engine=MYISAM;
connection con3;
-- echo "----------------- Connection 3"
create table test.t3(a int) engine=MYISAM;
# Verification
connection default;
-- echo "----------------- Connection default"
--disable_query_log
eval set @tid= $con1_THREAD_ID;
--enable_query_log
execute stmt_dump_events using @tid;
execute stmt_dump_thread using @tid;
--disable_query_log
eval set @tid= $con2_THREAD_ID;
--enable_query_log
execute stmt_dump_events using @tid;
execute stmt_dump_thread using @tid;
--disable_query_log
eval set @tid= $con3_THREAD_ID;
--enable_query_log
execute stmt_dump_events using @tid;
execute stmt_dump_thread using @tid;
# Cleanup
drop table test.t1;
drop table test.t2;
drop table test.t3;
--source ../include/cleanup_helper.inc

View File

@@ -0,0 +1 @@
--loose-pool-of-threads

View File

@@ -0,0 +1,362 @@
# 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
show grants;
grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION;
# Test denied privileges on performance_schema.*
--error ER_DBACCESS_DENIED_ERROR
grant ALL on performance_schema.* to 'pfs_user_2'@localhost
with GRANT OPTION;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant CREATE on performance_schema.* to 'pfs_user_2'@localhost;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant DROP on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant REFERENCES on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant INDEX on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant ALTER on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant CREATE TEMPORARY TABLES on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant EXECUTE on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant CREATE VIEW on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant SHOW VIEW on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant CREATE ROUTINE on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant ALTER ROUTINE on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant EVENT on performance_schema.* to 'pfs_user_2'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant TRIGGER on performance_schema.* to 'pfs_user_2'@localhost;
# Test allowed privileges on performance_schema.*
grant SELECT on performance_schema.* to 'pfs_user_2'@localhost;
grant INSERT on performance_schema.* to 'pfs_user_2'@localhost;
grant UPDATE on performance_schema.* to 'pfs_user_2'@localhost;
grant DELETE on performance_schema.* to 'pfs_user_2'@localhost;
grant LOCK TABLES on performance_schema.* to 'pfs_user_2'@localhost;
# Test denied privileges on specific performance_schema tables.
# SETUP_INSTRUMENT : example of PFS_updatable_acl
# EVENTS_WAITS_CURRENT : example of PFS_truncatable_acl
# FILE_INSTANCES : example of PFS_readonly_acl
--error ER_DBACCESS_DENIED_ERROR
grant ALL on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
with GRANT OPTION;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant CREATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant DROP on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant REFERENCES on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant INDEX on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant ALTER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant CREATE VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant SHOW VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant TRIGGER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
grant INSERT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
grant DELETE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost;
grant SELECT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
with GRANT OPTION;
grant UPDATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost
with GRANT OPTION;
--error ER_DBACCESS_DENIED_ERROR
grant ALL on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost
with GRANT OPTION;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant CREATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant DROP on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant REFERENCES on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant INDEX on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant ALTER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant CREATE VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant SHOW VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant TRIGGER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
grant INSERT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
grant UPDATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
grant DELETE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost;
grant SELECT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost
with GRANT OPTION;
--error ER_DBACCESS_DENIED_ERROR
grant ALL on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost
with GRANT OPTION;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant CREATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed
grant DROP on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant REFERENCES on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant INDEX on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant ALTER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant CREATE VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant SHOW VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--error ER_DBACCESS_DENIED_ERROR
grant TRIGGER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
grant INSERT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
grant UPDATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
--replace_result '\'file_instances' '\'FILE_INSTANCES'
--error ER_TABLEACCESS_DENIED_ERROR
grant DELETE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost;
grant SELECT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost
with GRANT OPTION;
# See bug#45354 LOCK TABLES is not a TABLE privilege
grant LOCK TABLES on performance_schema.* to 'pfs_user_3'@localhost
with GRANT OPTION;
flush privileges;
--source ../include/privilege.inc
connect (con1, localhost, pfs_user_1, , );
--source ../include/privilege.inc
--disconnect con1
connect (con2, localhost, pfs_user_2, , );
--source ../include/privilege.inc
--disconnect con2
connect (con3, localhost, pfs_user_3, , );
--source ../include/privilege.inc
--disconnect con3
--connection default
revoke all privileges, grant option from 'pfs_user_1'@localhost;
revoke all privileges, grant option from 'pfs_user_2'@localhost;
revoke all privileges, grant option from 'pfs_user_3'@localhost;
drop user 'pfs_user_1'@localhost;
drop user 'pfs_user_2'@localhost;
drop user 'pfs_user_3'@localhost;
flush privileges;
--echo # Test cases from WL#4818
--echo # Setup user
CREATE user pfs_user_4;
--connect (pfs_user_4, localhost, pfs_user_4, , )
--echo #
--echo # WL#4818, NFS4: Normal user does not have access to view data
--echo # without grants
--echo #
--connection pfs_user_4
--echo # Select as pfs_user_4 should fail without grant
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY;
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY_LONG;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
SELECT event_id FROM performance_schema.EVENTS_WAITS_CURRENT;
--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
SELECT event_name FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE;
--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE'
--error ER_TABLEACCESS_DENIED_ERROR
SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE;
--echo #
--echo # WL#4818, NFS3: Normal user does not have access to change what is
--echo # instrumented without grants
--echo #
--connection pfs_user_4
--echo # User pfs_user_4 should not be allowed to tweak instrumentation without
--echo # explicit grant
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS'
--error ER_TABLEACCESS_DENIED_ERROR
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS'
--error ER_TABLEACCESS_DENIED_ERROR
UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
--replace_result '\'setup_timers' '\'SETUP_TIMERS'
--error ER_TABLEACCESS_DENIED_ERROR
UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK';
--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG'
--error ER_TABLEACCESS_DENIED_ERROR
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY'
--error ER_TABLEACCESS_DENIED_ERROR
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT'
--error ER_TABLEACCESS_DENIED_ERROR
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
--echo #
--echo # WL#4814, NFS1: Can use grants to give normal user access
--echo # to turn on and off instrumentation
--echo #
--connection default
--echo # Grant access to change tables with the root account
GRANT UPDATE ON performance_schema.SETUP_CONSUMERS TO pfs_user_4;
GRANT UPDATE ON performance_schema.SETUP_TIMERS TO pfs_user_4;
GRANT UPDATE, SELECT ON performance_schema.SETUP_INSTRUMENTS TO pfs_user_4;
GRANT DROP ON performance_schema.EVENTS_WAITS_CURRENT TO pfs_user_4;
GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY TO pfs_user_4;
GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY_LONG TO pfs_user_4;
--connection pfs_user_4
--echo # User pfs_user_4 should now be allowed to tweak instrumentation
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES'
WHERE name LIKE 'wait/synch/mutex/%'
OR name LIKE 'wait/synch/rwlock/%';
UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK';
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY;
TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT;
--echo # Clean up
--connection default
--disconnect pfs_user_4
REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4;
DROP USER pfs_user_4;
flush privileges;
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES';
UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE';

View File

@@ -0,0 +1,68 @@
# 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
# This test verifies that performance schema tables, because they contain
# data that is volatile, are never cached in the query cache.
--source include/have_query_cache.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (a int not null);
insert into t1 values (1), (2), (3);
SET GLOBAL query_cache_size=1355776;
flush query cache;
reset query cache;
select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1;
select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_inserts";
show status like "Qcache_hits";
SET GLOBAL query_cache_size= default;
drop table t1;

View File

@@ -0,0 +1,96 @@
# 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
#
# Check that
# - a regular user can not update SETUP_ tables under --read-only
# - a user with SUPER privileges cam
--source include/not_embedded.inc
--source include/have_perfschema.inc
use performance_schema;
set @start_read_only= @@global.read_only;
grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost;
flush privileges;
--echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);
--echo connection default;
connection default;
set global read_only=0;
--echo connection con1;
connection con1;
select @@global.read_only;
show grants;
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
--enable_result_log
--echo connection default;
connection default;
set global read_only=1;
--echo connection con1;
connection con1;
select @@global.read_only;
show grants;
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS;
--error ER_OPTION_PREVENTS_STATEMENT
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
--error ER_OPTION_PREVENTS_STATEMENT
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
--enable_result_log
--echo connection default;
connection default;
grant super on *.* to pfsuser@localhost;
flush privileges;
disconnect con1;
--echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);
select @@global.read_only;
show grants;
--disable_result_log
select * from performance_schema.SETUP_INSTRUMENTS;
update performance_schema.SETUP_INSTRUMENTS set enabled='NO';
update performance_schema.SETUP_INSTRUMENTS set enabled='YES';
--enable_result_log
disconnect con1;
--echo connection default;
connection default;
set global read_only= @start_read_only;
drop user pfsuser@localhost;
flush privileges;

View File

@@ -0,0 +1,46 @@
# 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
--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 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;

View File

@@ -0,0 +1,156 @@
# 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
--source include/not_embedded.inc
--source include/have_perfschema.inc
#
# WL#4814, 4.1.2 STORAGE ENGINE, FSE8: Selects
#
# Make some data that we can work on:
UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES';
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value')
ENGINE=MyISAM;
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8);
# ORDER BY, GROUP BY and HAVING
--replace_column 2 [NUM_BYTES]
SELECT OPERATION, SUM(NUMBER_OF_BYTES) AS TOTAL
FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
GROUP BY OPERATION
HAVING TOTAL IS NOT NULL
ORDER BY OPERATION
LIMIT 1;
# Sub SELECT
--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)
AND EVENT_NAME IN
(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS
WHERE NAME LIKE "wait/synch/%")
LIMIT 1;
# JOIN
--replace_column 1 [EVENT_ID]
SELECT DISTINCT EVENT_ID
FROM performance_schema.EVENTS_WAITS_CURRENT
JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
JOIN performance_schema.EVENTS_WAITS_HISTORY_LONG USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
# Self JOIN
--replace_column 1 [THREAD_ID] 2 [EVENT_ID] 3 [EVENT_NAME] 4 [TIMER_WAIT]
SELECT t1.THREAD_ID, t2.EVENT_ID, t3.EVENT_NAME, t4.TIMER_WAIT
FROM performance_schema.EVENTS_WAITS_HISTORY t1
JOIN performance_schema.EVENTS_WAITS_HISTORY t2 USING (EVENT_ID)
JOIN performance_schema.EVENTS_WAITS_HISTORY t3 ON (t2.THREAD_ID = t3.THREAD_ID)
JOIN performance_schema.EVENTS_WAITS_HISTORY t4 ON (t3.EVENT_NAME = t4.EVENT_NAME)
ORDER BY t1.EVENT_ID, t2.EVENT_ID
LIMIT 5;
# UNION
--replace_column 1 [THREAD_ID] 2 [EVENT_ID]
SELECT THREAD_ID, EVENT_ID FROM (
SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT
UNION
SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY
UNION
SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY_LONG
) t1 ORDER BY THREAD_ID, EVENT_ID
LIMIT 5;
# EVENT
CREATE EVENT t_ps_event
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND
DO SELECT DISTINCT EVENT_ID
FROM performance_schema.EVENTS_WAITS_CURRENT
JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID)
ORDER BY EVENT_ID
LIMIT 1;
--sleep 2
# TRIGGER
ALTER TABLE t1 ADD COLUMN c INT;
delimiter |;
CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1
FOR EACH ROW BEGIN
SET NEW.c = (SELECT MAX(EVENT_ID)
FROM performance_schema.EVENTS_WAITS_CURRENT);
END;
|
delimiter ;|
INSERT INTO t1 (id) VALUES (11), (12), (13);
--replace_column 2 [EVENT_ID]
SELECT id, c FROM t1 WHERE id > 10 ORDER BY c;
DROP TRIGGER t_ps_trigger;
# PROCEDURE
delimiter |;
CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT)
BEGIN
SELECT id FROM performance_schema.PROCESSLIST
WHERE THREAD_ID = tid INTO pid;
END;
|
delimiter ;|
CALL t_ps_proc(0, @p_id);
# FUNCTION
delimiter |;
CREATE FUNCTION t_ps_func(tid INT) RETURNS int
BEGIN
return (SELECT id FROM performance_schema.PROCESSLIST
WHERE THREAD_ID = tid);
END;
|
delimiter ;|
SELECT t_ps_func(0) = @p_id;
DROP PROCEDURE t_ps_proc;
DROP FUNCTION t_ps_func;
# Clean up
DROP TABLE t1;

View File

@@ -0,0 +1,263 @@
# 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
# This test verifies that the mysys and server instruments are properly
# initialized and recorded by the performance schema during the bootstrap
# sequence in mysqld main().
# Note that some globals mutexes/rwlocks/conds that depend on #ifdef options
# or runtime options are not tested here, to have a predictable result.
use performance_schema;
# Verify that these global mutexes have been properly initilized in mysys
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_threads";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_malloc";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_open";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_isam";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/mysys/THR_LOCK_myisam_log";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_heap";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_net";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_charset";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/mysys/THR_LOCK_time";
# There are no global rwlock in mysys
# Verify that these global conditions have been properly initilized in mysys
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/mysys/THR_COND_threads";
# Verify that these global mutexes have been properly initilized in sql
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_mysql_create_db";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_open";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_lock_db";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_thread_count";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_mapped_file";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_status";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_error_log";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_delayed_insert";
# Named LOCK_uuid_short in 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/LOCK_uuid_short";
# Named LOCK_uuid_generator in 5.5, LOCK_uuid_short in 6.0
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_uuid_generator";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_delayed_status";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_delayed_create";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_crypt";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_slave_list";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_active_mi";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_manager";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_global_read_lock";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_global_system_variables";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_user_conn";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_prepared_stmt_count";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_connection_count";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_server_started";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_rpl_status";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOG_INFO::lock";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_event_metadata";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_event_queue";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_user_locks";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/LOCK_mdl";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/Cversion_lock";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/LOCK_audit_mask";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_xid_cache";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_plugin";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_gdl";
select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/tz_LOCK";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/slave_start";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML_active";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from MUTEX_INSTANCES
# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML_get";
# Verify that these global rwlocks have been properly initilized in sql
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_grant";
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_sys_init_connect";
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_sys_init_slave";
select count(name) from RWLOCK_INSTANCES
where name like "wait/synch/rwlock/sql/LOCK_system_variables_hash";
# Verify that these global conditions have been properly initilized in sql
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_server_started";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_refresh";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_thread_count";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_manager";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_global_read_lock";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_thread_cache";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_flush_thread_cache";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_rpl_status";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/Event_scheduler::COND_state";
select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_queue_state";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/COND_mdl";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/BML_class::COND_BML";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/BML_class::COND_BML_registered";
# Does not exist in mysql 5.5, 6.0 only
# select count(name) from COND_INSTANCES
# where name like "wait/synch/cond/sql/BML_class::COND_BML_release";

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_cond_classes=0

View File

@@ -0,0 +1,38 @@
# 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
--source ../include/start_server_common.inc
# Expect no classes
show variables like "performance_schema_max_cond_classes";
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/cond/%";
# We lost all the classes
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_COND_CLASSES_LOST';
# Expect no instances
select count(*) from performance_schema.COND_INSTANCES;
# Expect no instances lost
show status like "performance_schema_cond_instances_lost";

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_cond_instances=0

View File

@@ -0,0 +1,41 @@
# 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
--source ../include/start_server_common.inc
# Expect classes
show variables like "performance_schema_max_cond_classes";
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/cond/%";
# Expect no class lost
show status like "performance_schema_cond_classes_lost";
# Expect no instances
show variables like "performance_schema_max_cond_instances";
select count(*) from performance_schema.COND_INSTANCES;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_COND_INSTANCES_LOST';

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_file_classes=0

View File

@@ -0,0 +1,38 @@
# 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
--source ../include/start_server_common.inc
# Expect no classes
show variables like "performance_schema_max_file_classes";
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/io/file/%";
# We lost all the classes
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_FILE_CLASSES_LOST';
# Expect no instances
select count(*) from performance_schema.FILE_INSTANCES;
# Expect no instances lost
show status like "performance_schema_file_instances_lost";

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_file_instances=0

View File

@@ -0,0 +1,41 @@
# 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
--source ../include/start_server_common.inc
# Expect classes
show variables like "performance_schema_max_file_classes";
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/io/file/%";
# Expect no class lost
show status like "performance_schema_file_classes_lost";
# Expect no instances
show variables like "performance_schema_max_file_instances";
select count(*) from performance_schema.FILE_INSTANCES;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_FILE_INSTANCES_LOST';

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_mutex_classes=0

View File

@@ -0,0 +1,38 @@
# 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
--source ../include/start_server_common.inc
# Expect no classes
show variables like "performance_schema_max_mutex_classes";
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/mutex/%";
# We lost all the classes
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_CLASSES_LOST';
# Expect no instances
select count(*) from performance_schema.MUTEX_INSTANCES;
# Expect no instances lost
show status like "performance_schema_mutex_instances_lost";

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_mutex_instances=0

View File

@@ -0,0 +1,41 @@
# 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
--source ../include/start_server_common.inc
# Expect classes
show variables like "performance_schema_max_mutex_classes";
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/mutex/%";
# Expect no class lost
show status like "performance_schema_mutex_classes_lost";
# Expect no instances
show variables like "performance_schema_max_mutex_instances";
select count(*) from performance_schema.MUTEX_INSTANCES;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_INSTANCES_LOST';

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_rwlock_classes=0

View File

@@ -0,0 +1,38 @@
# 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
--source ../include/start_server_common.inc
# Expect no classes
show variables like "performance_schema_max_rwlock_classes";
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
# We lost all the classes
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_CLASSES_LOST';
# Expect no instances
select count(*) from performance_schema.RWLOCK_INSTANCES;
# Expect no instances lost
show status like "performance_schema_rwlock_instances_lost";

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_rwlock_instances=0

View File

@@ -0,0 +1,41 @@
# 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
--source ../include/start_server_common.inc
# Expect classes
show variables like "performance_schema_max_rwlock_classes";
select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
where name like "wait/synch/rwlock/%";
# Expect no class lost
show status like "performance_schema_rwlock_classes_lost";
# Expect no instances
show variables like "performance_schema_max_rwlock_instances";
select count(*) from performance_schema.RWLOCK_INSTANCES;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_INSTANCES_LOST';

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_thread_classes=0

View File

@@ -0,0 +1,38 @@
# 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
--source ../include/start_server_common.inc
# Expect no classes
show variables like "performance_schema_max_thread_classes";
select count(*) from performance_schema.SETUP_INSTRUMENTS
where name like "thread/%";
# We lost all the classes
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST';
# Expect no instances
select count(*) from performance_schema.PROCESSLIST;
# Expect no instances lost
show status like "performance_schema_thread_instances_lost";

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema --loose-performance_schema_max_thread_instances=0

View File

@@ -0,0 +1,42 @@
# 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
--source ../include/start_server_common.inc
# Expect classes
show variables like "performance_schema_max_thread_classes";
# Not observable yet
# select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS
# where name like "thread/%";
# Expect no class lost
show status like "performance_schema_thread_classes_lost";
# Expect no instances
show variables like "performance_schema_max_thread_instances";
select count(*) from performance_schema.PROCESSLIST;
# Expect instances lost
select variable_value > 0 from information_schema.global_status
where variable_name like 'PERFORMANCE_SCHEMA_THREAD_INSTANCES_LOST';

View File

@@ -0,0 +1 @@
--loose-disable-performance-schema

View File

@@ -0,0 +1,25 @@
# 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
--source ../include/start_server_common.inc
# Expecting all off / zero
show status like "performance_schema%";

View File

@@ -0,0 +1 @@
--loose-enable-performance-schema

View File

@@ -0,0 +1,25 @@
# 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
--source ../include/start_server_common.inc
# Expecting nothing lost with default parameters
show status like "performance_schema%";

View File

@@ -0,0 +1 @@
--loose-debug=+d,tampered_perfschema_table1

View File

@@ -0,0 +1,44 @@
# 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
# This test uses error injection,
# see PFS_engine_table_share::check_all_tables()
# Verify that the server starts even when a performance schema table
# is corrupted, with an incompatible change.
# Verify that using that table nicely fails.
# Verify that other tables are not affected.
--source include/have_debug.inc
--source include/not_embedded.inc
--source include/have_perfschema.inc
# The message prints 'mysql.SETUP_INSTRUMENTS'
# instead of 'performance_schema.SETUP_INSTRUMENTS',
# due to Bug#46792
call mtr.add_suppression(
"Column count of mysql.SETUP_INSTRUMENTS is wrong. "
"Expected 4, found 3. The table is probably corrupted");
--error ER_WRONG_NATIVE_TABLE_STRUCTURE
select * from performance_schema.SETUP_INSTRUMENTS limit 1;
--disable_result_log
select * from performance_schema.SETUP_CONSUMERS limit 1;
--enable_result_log