diff options
author | Marc Alff <marc.alff@oracle.com> | 2010-11-03 16:42:33 +0100 |
---|---|---|
committer | Marc Alff <marc.alff@oracle.com> | 2010-11-03 16:42:33 +0100 |
commit | 4e1678daca86af018fb4921a15e87ec28dbaacd1 (patch) | |
tree | cff6f31235af55879a5dfdaeee156837410d852f /mysql-test/suite/perfschema/include | |
parent | 02ca1fe3f12052f4d8bb14d0e394af480eccce3d (diff) | |
download | mariadb-git-4e1678daca86af018fb4921a15e87ec28dbaacd1.tar.gz |
Bug#57609 performance_schema does not work with lower_case_table_names
Before this fix, the performance schema tables were defined in UPPERCASE.
This was incompatible with the lowercase_table_names option, and caused
issues with the install / upgrade process, when changing the lower case
table names setting *after* the install or upgrade.
With this fix, all performance schema tables are exposed with lowercase names.
As a result, the name of the performance schema table is always lowercase,
no matter how / if / when the lowercase_table_names setting if changed.
Diffstat (limited to 'mysql-test/suite/perfschema/include')
5 files changed, 76 insertions, 91 deletions
diff --git a/mysql-test/suite/perfschema/include/binlog_common.inc b/mysql-test/suite/perfschema/include/binlog_common.inc index 10afe54ab5b..96c01d9a4c8 100644 --- a/mysql-test/suite/perfschema/include/binlog_common.inc +++ b/mysql-test/suite/perfschema/include/binlog_common.inc @@ -17,12 +17,12 @@ RESET MASTER; -select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +select count(*) > 0 from performance_schema.setup_instruments; -update performance_schema.SETUP_INSTRUMENTS set enabled='NO' +update performance_schema.setup_instruments set enabled='NO' where name like "wait/synch/rwlock/%"; -select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT; +select count(*) > 0 from performance_schema.events_waits_current; --disable_warnings drop table if exists test.t1; @@ -33,16 +33,16 @@ create table test.t1 (thread_id integer); create table test.t2 (name varchar(128)); insert into test.t1 - select thread_id from performance_schema.EVENTS_WAITS_CURRENT; + select thread_id from performance_schema.events_waits_current; insert into test.t2 - select name from performance_schema.SETUP_INSTRUMENTS + select name from performance_schema.setup_instruments where name like "wait/synch/rwlock/%"; drop table test.t1; drop table test.t2; -update performance_schema.SETUP_INSTRUMENTS set enabled='YES' +update performance_schema.setup_instruments set enabled='YES' where name like "wait/synch/rwlock/%"; --source include/show_binlog_events.inc diff --git a/mysql-test/suite/perfschema/include/cleanup_helper.inc b/mysql-test/suite/perfschema/include/cleanup_helper.inc index 5c2429ddb97..b7e37849f78 100644 --- a/mysql-test/suite/perfschema/include/cleanup_helper.inc +++ b/mysql-test/suite/perfschema/include/cleanup_helper.inc @@ -15,7 +15,7 @@ # Tests for PERFORMANCE_SCHEMA -update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +update performance_schema.setup_instruments set enabled='YES'; disconnect con1; disconnect con2; diff --git a/mysql-test/suite/perfschema/include/privilege.inc b/mysql-test/suite/perfschema/include/privilege.inc index ef2acc995d5..3973c41b51b 100644 --- a/mysql-test/suite/perfschema/include/privilege.inc +++ b/mysql-test/suite/perfschema/include/privilege.inc @@ -32,48 +32,48 @@ drop table if exists test.t1; ## drop table performance_schema.t1; ## ## --error ER_DBACCESS_DENIED_ERROR -## create table performance_schema.SETUP_INSTRUMENTS(a int); +## create table performance_schema.setup_instruments(a int); ## ## --error ER_DBACCESS_DENIED_ERROR -## create table performance_schema.EVENTS_WAITS_CURRENT(a int); +## create table performance_schema.events_waits_current(a int); ## ## --error ER_DBACCESS_DENIED_ERROR -## create table performance_schema.FILE_INSTANCES(a int); +## create table performance_schema.file_instances(a int); ## ## --error ER_DBACCESS_DENIED_ERROR -## drop table performance_schema.SETUP_INSTRUMENTS; +## drop table performance_schema.setup_instruments; ## ## --error ER_DBACCESS_DENIED_ERROR -## drop table performance_schema.EVENTS_WAITS_CURRENT; +## drop table performance_schema.events_waits_current; ## ## --error ER_DBACCESS_DENIED_ERROR -## drop table performance_schema.FILE_INSTANCES; +## drop table performance_schema.file_instances; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.SETUP_INSTRUMENTS to test.t1; +rename table performance_schema.setup_instruments to test.t1; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1; +rename table performance_schema.events_waits_current to test.t1; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.FILE_INSTANCES to test.t1; +rename table performance_schema.file_instances to test.t1; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1; +rename table performance_schema.setup_instruments to performance_schema.t1; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1; +rename table performance_schema.events_waits_current to performance_schema.t1; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.FILE_INSTANCES to performance_schema.t1; +rename table performance_schema.file_instances to performance_schema.t1; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.SETUP_INSTRUMENTS - to performance_schema.EVENTS_WAITS_CURRENT; +rename table performance_schema.setup_instruments + to performance_schema.events_waits_current; --error ER_DBACCESS_DENIED_ERROR -rename table performance_schema.EVENTS_WAITS_CURRENT - to performance_schema.SETUP_INSTRUMENTS; +rename table performance_schema.events_waits_current + to performance_schema.setup_instruments; --error ER_DBACCESS_DENIED_ERROR create procedure performance_schema.my_proc() begin end; @@ -87,108 +87,93 @@ do begin end; --error ER_DBACCESS_DENIED_ERROR create trigger performance_schema.bi_setup_instruments - before insert on performance_schema.SETUP_INSTRUMENTS + before insert on performance_schema.setup_instruments for each row begin end; --error ER_DBACCESS_DENIED_ERROR create trigger performance_schema.bi_events_waits_current - before insert on performance_schema.EVENTS_WAITS_CURRENT + before insert on performance_schema.events_waits_current for each row begin end; --error ER_DBACCESS_DENIED_ERROR create trigger performance_schema.bi_file_instances - before insert on performance_schema.FILE_INSTANCES + before insert on performance_schema.file_instances for each row begin end; --error ER_WRONG_PERFSCHEMA_USAGE create table test.t1(a int) engine=PERFORMANCE_SCHEMA; --error ER_WRONG_PERFSCHEMA_USAGE -create table test.t1 like performance_schema.SETUP_INSTRUMENTS; +create table test.t1 like performance_schema.setup_instruments; --error ER_WRONG_PERFSCHEMA_USAGE -create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; +create table test.t1 like performance_schema.events_waits_current; --error ER_WRONG_PERFSCHEMA_USAGE -create table test.t1 like performance_schema.FILE_INSTANCES; +create table test.t1 like performance_schema.file_instances; ---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' --error ER_TABLEACCESS_DENIED_ERROR -insert into performance_schema.SETUP_INSTRUMENTS +insert into performance_schema.setup_instruments set name="foo"; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -insert into performance_schema.EVENTS_WAITS_CURRENT +insert into performance_schema.events_waits_current set name="foo"; ---replace_result '\'file_instances' '\'FILE_INSTANCES' --error ER_TABLEACCESS_DENIED_ERROR -insert into performance_schema.FILE_INSTANCES +insert into performance_schema.file_instances set name="foo"; ---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' --error ER_TABLEACCESS_DENIED_ERROR -delete from performance_schema.SETUP_INSTRUMENTS; +delete from performance_schema.setup_instruments; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -delete from performance_schema.EVENTS_WAITS_CURRENT; +delete from performance_schema.events_waits_current; ---replace_result '\'file_instances' '\'FILE_INSTANCES' --error ER_TABLEACCESS_DENIED_ERROR -delete from performance_schema.FILE_INSTANCES; +delete from performance_schema.file_instances; -lock table performance_schema.SETUP_INSTRUMENTS read; +lock table performance_schema.setup_instruments read; unlock tables; -lock table performance_schema.SETUP_INSTRUMENTS write; +lock table performance_schema.setup_instruments write; unlock tables; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -lock table performance_schema.EVENTS_WAITS_CURRENT read; +lock table performance_schema.events_waits_current read; unlock tables; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -lock table performance_schema.EVENTS_WAITS_CURRENT write; +lock table performance_schema.events_waits_current write; unlock tables; ---replace_result '\'file_instances' '\'FILE_INSTANCES' --error ER_TABLEACCESS_DENIED_ERROR -lock table performance_schema.FILE_INSTANCES read; +lock table performance_schema.file_instances read; unlock tables; ---replace_result '\'file_instances' '\'FILE_INSTANCES' --error ER_TABLEACCESS_DENIED_ERROR -lock table performance_schema.FILE_INSTANCES write; +lock table performance_schema.file_instances write; unlock tables; --echo # --echo # WL#4818, NFS2: Can use grants to give normal user access ---echo # to view data from _CURRENT and _HISTORY tables +--echo # to view data from _current and _history tables --echo # --echo # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3. ---echo # (Except for EVENTS_WAITS_CURRENT, which is granted.) +--echo # (Except for events_waits_current, which is granted.) # Errors here will be caught by the diff afterwards --disable_abort_on_error ---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' -SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1; +SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1; ---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' -SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1; +SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' -SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1; +SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1; ---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' -SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1; +SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1; ---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' -SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1; +SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1; --enable_abort_on_error diff --git a/mysql-test/suite/perfschema/include/setup_helper.inc b/mysql-test/suite/perfschema/include/setup_helper.inc index 195b9cf960a..cdbfd81a24c 100644 --- a/mysql-test/suite/perfschema/include/setup_helper.inc +++ b/mysql-test/suite/perfschema/include/setup_helper.inc @@ -19,23 +19,23 @@ let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_TMPDIR= `select @@tmpdir`; --disable_query_log -update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; -update performance_schema.SETUP_CONSUMERS set enabled='YES'; +update performance_schema.setup_instruments set enabled='NO'; +update performance_schema.setup_consumers set enabled='YES'; --enable_query_log connect (con1, localhost, root, , ); -let $con1_THREAD_ID=`select thread_id from performance_schema.THREADS +let $con1_THREAD_ID=`select thread_id from performance_schema.threads where PROCESSLIST_ID = connection_id()`; connect (con2, localhost, root, , ); -let $con2_THREAD_ID=`select thread_id from performance_schema.THREADS +let $con2_THREAD_ID=`select thread_id from performance_schema.threads where PROCESSLIST_ID = connection_id()`; connect (con3, localhost, root, , ); -let $con3_THREAD_ID=`select thread_id from performance_schema.THREADS +let $con3_THREAD_ID=`select thread_id from performance_schema.threads where PROCESSLIST_ID = connection_id()`; connection default; @@ -45,10 +45,10 @@ prepare stmt_dump_events from "select event_name, left(source, locate(\":\", source)) as short_source, operation, number_of_bytes - from performance_schema.EVENTS_WAITS_HISTORY_LONG + from performance_schema.events_waits_history_long where thread_id=? order by event_id;"; prepare stmt_dump_thread from - "select name from performance_schema.THREADS where thread_id=? ;"; + "select name from performance_schema.threads where thread_id=? ;"; --enable_query_log diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc index 083b302c5f7..f6e549ea44e 100644 --- a/mysql-test/suite/perfschema/include/start_server_common.inc +++ b/mysql-test/suite/perfschema/include/start_server_common.inc @@ -17,31 +17,31 @@ show databases; -select count(*) from performance_schema.PERFORMANCE_TIMERS; -select count(*) from performance_schema.SETUP_CONSUMERS; -select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; -select count(*) from performance_schema.SETUP_TIMERS; +select count(*) from performance_schema.performance_timers; +select count(*) from performance_schema.setup_consumers; +select count(*) > 0 from performance_schema.setup_instruments; +select count(*) from performance_schema.setup_timers; # Make sure we don't crash, no matter what the starting parameters are --disable_result_log -select * from performance_schema.COND_INSTANCES; -select * from performance_schema.EVENTS_WAITS_CURRENT; -select * from performance_schema.EVENTS_WAITS_HISTORY; -select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; -select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; -select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; -select * from performance_schema.EVENTS_WAITS_SUMMARY_GLOBAL_BY_EVENT_NAME; -select * from performance_schema.FILE_INSTANCES; -select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; -select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; -select * from performance_schema.MUTEX_INSTANCES; -select * from performance_schema.PERFORMANCE_TIMERS; -select * from performance_schema.RWLOCK_INSTANCES; -select * from performance_schema.SETUP_CONSUMERS; -select * from performance_schema.SETUP_INSTRUMENTS; -select * from performance_schema.SETUP_TIMERS; -select * from performance_schema.THREADS; +select * from performance_schema.cond_instances; +select * from performance_schema.events_waits_current; +select * from performance_schema.events_waits_history; +select * from performance_schema.events_waits_history_long; +select * from performance_schema.events_waits_summary_by_instance; +select * from performance_schema.events_waits_summary_by_thread_by_event_name; +select * from performance_schema.events_waits_summary_global_by_event_name; +select * from performance_schema.file_instances; +select * from performance_schema.file_summary_by_event_name; +select * from performance_schema.file_summary_by_instance; +select * from performance_schema.mutex_instances; +select * from performance_schema.performance_timers; +select * from performance_schema.rwlock_instances; +select * from performance_schema.setup_consumers; +select * from performance_schema.setup_instruments; +select * from performance_schema.setup_timers; +select * from performance_schema.threads; --enable_result_log # This has a stable output, printing the result: |