Commit 97b8f8cf authored by Marc Alff's avatar Marc Alff
Browse files

WL#2360 Performance schema

Part IV: sql instrumentation
parent b7409253
......@@ -101,7 +101,7 @@ enum options_client
/**
First mysql version supporting the performance schema.
*/
#define FIRST_PERFORMANCE_SCHEMA_VERSION 50600
#define FIRST_PERFORMANCE_SCHEMA_VERSION 50599
/**
Name of the performance schema database.
......
......@@ -501,7 +501,19 @@ int init_embedded_server(int argc, char **argv, char **groups)
*/
logger.init_base();
if (init_common_variables("my", *argcp, *argvp, (const char **)groups))
orig_argc= *argcp;
orig_argv= *argvp;
load_defaults("my", (const char **)groups, argcp, argvp);
defaults_argc= *argcp;
defaults_argv= *argvp;
remaining_argc= argc;
remaining_argv= argv;
/* Must be initialized early for comparison of options name */
system_charset_info= &my_charset_utf8_general_ci;
sys_var_init();
if (init_common_variables())
{
mysql_server_end();
return 1;
......
# Copyright (C) 2010 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
if (!`SELECT count(*) FROM information_schema.engines WHERE
(support = 'YES' OR support = 'DEFAULT') AND
engine = 'PERFORMANCE_SCHEMA'`){
skip Need performance schema compiled in;
}
create table t1 (test_name text);
create table t2 (variable_name text);
load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1;
select variable_name as `There should be *no* variables listed below:`
from information_schema.global_variables
left join t1 on variable_name=test_name where
test_name is null
union
select variable_name from information_schema.session_variables
left join t1 on variable_name=test_name where
test_name is null;
insert into t2 select variable_name from information_schema.global_variables;
insert into t2 select variable_name from information_schema.session_variables;
update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
select variable_name as `There should be *no* long test name listed below:` from t2
where length(variable_name) > 50;
There should be *no* long test name listed below:
select variable_name as `There should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null;
There should be *no* variables listed below:
drop table t1;
drop table t2;
select @@global.performance_schema;
@@global.performance_schema
1
select @@session.performance_schema;
ERROR HY000: Variable 'performance_schema' is a GLOBAL variable
show global variables like 'performance_schema';
Variable_name Value
performance_schema ON
show session variables like 'performance_schema';
Variable_name Value
performance_schema ON
select * from information_schema.global_variables
where variable_name='performance_schema';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA ON
select * from information_schema.session_variables
where variable_name='performance_schema';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA ON
set global performance_schema=1;
ERROR HY000: Variable 'performance_schema' is a read only variable
set session performance_schema=1;
ERROR HY000: Variable 'performance_schema' is a read only variable
select @@global.performance_schema_events_waits_history_long_size;
@@global.performance_schema_events_waits_history_long_size
15000
select @@session.performance_schema_events_waits_history_long_size;
ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a GLOBAL variable
show global variables like 'performance_schema_events_waits_history_long_size';
Variable_name Value
performance_schema_events_waits_history_long_size 15000
show session variables like 'performance_schema_events_waits_history_long_size';
Variable_name Value
performance_schema_events_waits_history_long_size 15000
select * from information_schema.global_variables
where variable_name='performance_schema_events_waits_history_long_size';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE 15000
select * from information_schema.session_variables
where variable_name='performance_schema_events_waits_history_long_size';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE 15000
set global performance_schema_events_waits_history_long_size=1;
ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a read only variable
set session performance_schema_events_waits_history_long_size=1;
ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a read only variable
select @@global.performance_schema_events_waits_history_size;
@@global.performance_schema_events_waits_history_size
15
select @@session.performance_schema_events_waits_history_size;
ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a GLOBAL variable
show global variables like 'performance_schema_events_waits_history_size';
Variable_name Value
performance_schema_events_waits_history_size 15
show session variables like 'performance_schema_events_waits_history_size';
Variable_name Value
performance_schema_events_waits_history_size 15
select * from information_schema.global_variables
where variable_name='performance_schema_events_waits_history_size';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE 15
select * from information_schema.session_variables
where variable_name='performance_schema_events_waits_history_size';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE 15
set global performance_schema_events_waits_history_size=1;
ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a read only variable
set session performance_schema_events_waits_history_size=1;
ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a read only variable
select @@global.performance_schema_max_cond_classes;
@@global.performance_schema_max_cond_classes
123
select @@session.performance_schema_max_cond_classes;
ERROR HY000: Variable 'performance_schema_max_cond_classes' is a GLOBAL variable
show global variables like 'performance_schema_max_cond_classes';
Variable_name Value
performance_schema_max_cond_classes 123
show session variables like 'performance_schema_max_cond_classes';
Variable_name Value
performance_schema_max_cond_classes 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_cond_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_COND_CLASSES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_cond_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_COND_CLASSES 123
set global performance_schema_max_cond_classes=1;
ERROR HY000: Variable 'performance_schema_max_cond_classes' is a read only variable
set session performance_schema_max_cond_classes=1;
ERROR HY000: Variable 'performance_schema_max_cond_classes' is a read only variable
select @@global.performance_schema_max_cond_instances;
@@global.performance_schema_max_cond_instances
123
select @@session.performance_schema_max_cond_instances;
ERROR HY000: Variable 'performance_schema_max_cond_instances' is a GLOBAL variable
show global variables like 'performance_schema_max_cond_instances';
Variable_name Value
performance_schema_max_cond_instances 123
show session variables like 'performance_schema_max_cond_instances';
Variable_name Value
performance_schema_max_cond_instances 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_cond_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_COND_INSTANCES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_cond_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_COND_INSTANCES 123
set global performance_schema_max_cond_instances=1;
ERROR HY000: Variable 'performance_schema_max_cond_instances' is a read only variable
set session performance_schema_max_cond_instances=1;
ERROR HY000: Variable 'performance_schema_max_cond_instances' is a read only variable
select @@global.performance_schema_max_file_classes;
@@global.performance_schema_max_file_classes
123
select @@session.performance_schema_max_file_classes;
ERROR HY000: Variable 'performance_schema_max_file_classes' is a GLOBAL variable
show global variables like 'performance_schema_max_file_classes';
Variable_name Value
performance_schema_max_file_classes 123
show session variables like 'performance_schema_max_file_classes';
Variable_name Value
performance_schema_max_file_classes 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_file_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_FILE_CLASSES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_file_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_FILE_CLASSES 123
set global performance_schema_max_file_classes=1;
ERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable
set session performance_schema_max_file_classes=1;
ERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable
select @@global.performance_schema_max_file_handles;
@@global.performance_schema_max_file_handles
123
select @@session.performance_schema_max_file_handles;
ERROR HY000: Variable 'performance_schema_max_file_handles' is a GLOBAL variable
show global variables like 'performance_schema_max_file_handles';
Variable_name Value
performance_schema_max_file_handles 123
show session variables like 'performance_schema_max_file_handles';
Variable_name Value
performance_schema_max_file_handles 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_file_handles';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_FILE_HANDLES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_file_handles';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_FILE_HANDLES 123
set global performance_schema_max_file_handles=1;
ERROR HY000: Variable 'performance_schema_max_file_handles' is a read only variable
set session performance_schema_max_file_handles=1;
ERROR HY000: Variable 'performance_schema_max_file_handles' is a read only variable
select @@global.performance_schema_max_file_instances;
@@global.performance_schema_max_file_instances
123
select @@session.performance_schema_max_file_instances;
ERROR HY000: Variable 'performance_schema_max_file_instances' is a GLOBAL variable
show global variables like 'performance_schema_max_file_instances';
Variable_name Value
performance_schema_max_file_instances 123
show session variables like 'performance_schema_max_file_instances';
Variable_name Value
performance_schema_max_file_instances 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_file_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_file_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES 123
set global performance_schema_max_file_instances=1;
ERROR HY000: Variable 'performance_schema_max_file_instances' is a read only variable
set session performance_schema_max_file_instances=1;
ERROR HY000: Variable 'performance_schema_max_file_instances' is a read only variable
select @@global.performance_schema_max_mutex_classes;
@@global.performance_schema_max_mutex_classes
123
select @@session.performance_schema_max_mutex_classes;
ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a GLOBAL variable
show global variables like 'performance_schema_max_mutex_classes';
Variable_name Value
performance_schema_max_mutex_classes 123
show session variables like 'performance_schema_max_mutex_classes';
Variable_name Value
performance_schema_max_mutex_classes 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_mutex_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_mutex_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES 123
set global performance_schema_max_mutex_classes=1;
ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a read only variable
set session performance_schema_max_mutex_classes=1;
ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a read only variable
select @@global.performance_schema_max_mutex_instances;
@@global.performance_schema_max_mutex_instances
123
select @@session.performance_schema_max_mutex_instances;
ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a GLOBAL variable
show global variables like 'performance_schema_max_mutex_instances';
Variable_name Value
performance_schema_max_mutex_instances 123
show session variables like 'performance_schema_max_mutex_instances';
Variable_name Value
performance_schema_max_mutex_instances 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_mutex_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_mutex_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES 123
set global performance_schema_max_mutex_instances=1;
ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a read only variable
set session performance_schema_max_mutex_instances=1;
ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a read only variable
select @@global.performance_schema_max_rwlock_classes;
@@global.performance_schema_max_rwlock_classes
123
select @@session.performance_schema_max_rwlock_classes;
ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a GLOBAL variable
show global variables like 'performance_schema_max_rwlock_classes';
Variable_name Value
performance_schema_max_rwlock_classes 123
show session variables like 'performance_schema_max_rwlock_classes';
Variable_name Value
performance_schema_max_rwlock_classes 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_rwlock_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_rwlock_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES 123
set global performance_schema_max_rwlock_classes=1;
ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a read only variable
set session performance_schema_max_rwlock_classes=1;
ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a read only variable
select @@global.performance_schema_max_rwlock_instances;
@@global.performance_schema_max_rwlock_instances
123
select @@session.performance_schema_max_rwlock_instances;
ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a GLOBAL variable
show global variables like 'performance_schema_max_rwlock_instances';
Variable_name Value
performance_schema_max_rwlock_instances 123
show session variables like 'performance_schema_max_rwlock_instances';
Variable_name Value
performance_schema_max_rwlock_instances 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_rwlock_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_rwlock_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES 123
set global performance_schema_max_rwlock_instances=1;
ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a read only variable
set session performance_schema_max_rwlock_instances=1;
ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a read only variable
select @@global.performance_schema_max_table_handles;
@@global.performance_schema_max_table_handles
123
select @@session.performance_schema_max_table_handles;
ERROR HY000: Variable 'performance_schema_max_table_handles' is a GLOBAL variable
show global variables like 'performance_schema_max_table_handles';
Variable_name Value
performance_schema_max_table_handles 123
show session variables like 'performance_schema_max_table_handles';
Variable_name Value
performance_schema_max_table_handles 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_table_handles';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_table_handles';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES 123
set global performance_schema_max_table_handles=1;
ERROR HY000: Variable 'performance_schema_max_table_handles' is a read only variable
set session performance_schema_max_table_handles=1;
ERROR HY000: Variable 'performance_schema_max_table_handles' is a read only variable
select @@global.performance_schema_max_table_instances;
@@global.performance_schema_max_table_instances
123
select @@session.performance_schema_max_table_instances;
ERROR HY000: Variable 'performance_schema_max_table_instances' is a GLOBAL variable
show global variables like 'performance_schema_max_table_instances';
Variable_name Value
performance_schema_max_table_instances 123
show session variables like 'performance_schema_max_table_instances';
Variable_name Value
performance_schema_max_table_instances 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_table_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_table_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES 123
set global performance_schema_max_table_instances=1;
ERROR HY000: Variable 'performance_schema_max_table_instances' is a read only variable
set session performance_schema_max_table_instances=1;
ERROR HY000: Variable 'performance_schema_max_table_instances' is a read only variable
select @@global.performance_schema_max_thread_classes;
@@global.performance_schema_max_thread_classes
123
select @@session.performance_schema_max_thread_classes;
ERROR HY000: Variable 'performance_schema_max_thread_classes' is a GLOBAL variable
show global variables like 'performance_schema_max_thread_classes';
Variable_name Value
performance_schema_max_thread_classes 123
show session variables like 'performance_schema_max_thread_classes';
Variable_name Value
performance_schema_max_thread_classes 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_thread_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_thread_classes';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES 123
set global performance_schema_max_thread_classes=1;
ERROR HY000: Variable 'performance_schema_max_thread_classes' is a read only variable
set session performance_schema_max_thread_classes=1;
ERROR HY000: Variable 'performance_schema_max_thread_classes' is a read only variable
select @@global.performance_schema_max_thread_instances;
@@global.performance_schema_max_thread_instances
123
select @@session.performance_schema_max_thread_instances;
ERROR HY000: Variable 'performance_schema_max_thread_instances' is a GLOBAL variable
show global variables like 'performance_schema_max_thread_instances';
Variable_name Value
performance_schema_max_thread_instances 123
show session variables like 'performance_schema_max_thread_instances';
Variable_name Value
performance_schema_max_thread_instances 123
select * from information_schema.global_variables
where variable_name='performance_schema_max_thread_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES 123
select * from information_schema.session_variables
where variable_name='performance_schema_max_thread_instances';
VARIABLE_NAME VARIABLE_VALUE
PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES 123
set global performance_schema_max_thread_instances=1;
ERROR HY000: Variable 'performance_schema_max_thread_instances' is a read only variable
set session performance_schema_max_thread_instances=1;
ERROR HY000: Variable 'performance_schema_max_thread_instances' is a read only variable
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment