List:Commits« Previous MessageNext Message »
From:Mark Leith Date:February 9 2013 1:21pm
Subject:bzr push into mysql-5.6 branch (mark.leith:4747 to 4748) Bug#11766693
View as plain text  
 4748 Mark Leith	2013-02-09
      Bug #11766693: LOG-SLOW-ADMIN-STATEMENTS AND LOG-SLOW-SLAVE-STATEMENTS NOT
      DISPLAYED
      
      Added both log_slow_admin_statements and log_slow_slave_statements as server
      system variables, that can now be dynamically set at run time and are now
      available via SHOW GLOBAL VARIABLES. These behave otherwise in the same way as
      the --log-slow-admin-statements and --log-slow-slave-statements server command
      options.
      
      There is no need to restart the slave SQL thread for the value of
      log_slow_slave_statements to be picked up, as the global variable is re-read
      with each successful event applied by the SQL thread.

    added:
      mysql-test/suite/sys_vars/r/log_slow_admin_statements_basic.result
      mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result
      mysql-test/suite/sys_vars/r/log_slow_slave_statements_basic.result
      mysql-test/suite/sys_vars/t/log_slow_admin_statements_basic.test
      mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test
      mysql-test/suite/sys_vars/t/log_slow_slave_statements_basic.test
    modified:
      mysql-test/r/variables.result
      mysql-test/suite/rpl/r/rpl_slow_query_log.result
      mysql-test/suite/rpl/t/rpl_slow_query_log.test
      mysql-test/t/variables.test
      sql/mysqld.cc
      sql/sys_vars.cc
 4747 Anitha Gopi	2013-02-09
      Moving an unstable test to experimental group on windows

    modified:
      mysql-test/collections/default.experimental
=== modified file 'mysql-test/r/variables.result'
=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result	revid:anitha.gopi@stripped
+++ b/mysql-test/r/variables.result	revid:mark.leith@stripped
@@ -1799,3 +1799,26 @@
 #
 SET @@sql_mode= 4294967296;
 ERROR 42000: Variable 'sql_mode' can't be set to the value of '4294967296'
+#
+# Bug #59860: log-slow-admin-statements and log-slow-slave-statements not displayed
+#
+show variables like 'log_slow%';
+Variable_name	Value
+log_slow_admin_statements	OFF
+log_slow_slave_statements	OFF
+set global log_slow_admin_statements = on;
+show global variables like 'log_slow_admin_statements';
+Variable_name	Value
+log_slow_admin_statements	ON
+select * from information_schema.global_variables where variable_name like 'log_slow_admin_statements';
+VARIABLE_NAME	VARIABLE_VALUE
+LOG_SLOW_ADMIN_STATEMENTS	ON
+set global log_slow_slave_statements = on;
+show global variables like 'log_slow_slave_statements';
+Variable_name	Value
+log_slow_slave_statements	ON
+select * from information_schema.global_variables where variable_name like 'log_slow_slave_statements';
+VARIABLE_NAME	VARIABLE_VALUE
+LOG_SLOW_SLAVE_STATEMENTS	ON
+set global log_slow_admin_statements = default;
+set global log_slow_slave_statements = default;

=== modified file 'mysql-test/suite/rpl/r/rpl_slow_query_log.result'
--- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result	revid:anitha.gopi@stripped
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result	revid:mark.leith@stripped
@@ -79,9 +79,20 @@
 INSERT INTO t1 values(1, sleep(3));
 ### Assertion is good. Both Master and Slave exhibit the 
 ### same number of queries in slow log: 1
+********************************************************************
+**** TRUNCATE the slow log then check whether runtime changes of
+**** log_slow_slave_statements work without slave restart.
+********************************************************************
+SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
+SET @@global.log_slow_slave_statements = off;
+TRUNCATE mysql.slow_log;
+INSERT INTO t1 values(1, sleep(3));;
+SET @@global.log_slow_slave_statements = on;
+INSERT INTO t1 values(1, sleep(3));;
 SET @@global.log_output= @old_log_output;
 SET @@global.long_query_time= @old_long_query_time;
 DROP TABLE t1;
 SET @@global.log_output= @old_log_output;
 SET @@global.long_query_time= @old_long_query_time;
+SET @@global.log_slow_slave_statements= @old_log_slow_slave_statements;
 include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_slow_query_log.test'
--- a/mysql-test/suite/rpl/t/rpl_slow_query_log.test	revid:anitha.gopi@stripped
+++ b/mysql-test/suite/rpl/t/rpl_slow_query_log.test	revid:mark.leith@stripped
@@ -299,6 +299,49 @@
   -- echo ### same number of queries in slow log: $master_slow_query
 }
 
+-- echo ********************************************************************
+-- echo **** TRUNCATE the slow log then check whether runtime changes of
+-- echo **** log_slow_slave_statements work without slave restart.
+-- echo ********************************************************************
+
+SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
+SET @@global.log_slow_slave_statements = off;
+TRUNCATE mysql.slow_log;
+
+-- connection master
+
+--disable_warnings
+-- eval $slow_query;
+--enable_warnings
+
+-- sync_slave_with_master
+-- connection slave
+
+let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+if ($slave_slow_query)
+{
+  SELECT * FROM mysql.slow_log;
+  die "Assertion failed! Slow query FOUND in slow query log. Bailing out!";
+}
+
+SET @@global.log_slow_slave_statements = on;
+
+-- connection master
+
+--disable_warnings
+-- eval $slow_query;
+--enable_warnings
+
+-- sync_slave_with_master
+-- connection slave
+
+let $slave_slow_query= `SELECT count(*) = 1 FROM mysql.slow_log WHERE sql_text like '$slow_query'`;
+if (!$slave_slow_query)
+{
+  SELECT * FROM mysql.slow_log;
+  die "Assertion failed! Slow query NOT FOUND in slow query log. Bailing out!";
+}
+
 -- connection master
 SET @@global.log_output= @old_log_output;
 SET @@global.long_query_time= @old_long_query_time;
@@ -307,4 +350,5 @@
 -- sync_slave_with_master
 SET @@global.log_output= @old_log_output;
 SET @@global.long_query_time= @old_long_query_time;
+SET @@global.log_slow_slave_statements= @old_log_slow_slave_statements;
 --source include/rpl_end.inc

=== added file 'mysql-test/suite/sys_vars/r/log_slow_admin_statements_basic.result'
--- a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_basic.result	revid:mark.leith@stripped
@@ -0,0 +1,76 @@
+SET @start_value= @@global.log_slow_admin_statements;
+SET @@global.log_slow_admin_statements= DEFAULT;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+0
+SET @@global.log_slow_admin_statements= TRUE;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+1
+SET @@global.log_slow_admin_statements= true;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+1
+SET @@global.log_slow_admin_statements= 0;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+0
+SET @@global.log_slow_admin_statements= 1;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+1
+SET @goodvar= TRUE;
+SET @@global.log_slow_admin_statements= @goodvar;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+1
+SET GLOBAL log_slow_admin_statements= DEFAULT;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+0
+SET GLOBAL log_slow_admin_statements= ON;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+1
+SET GLOBAL log_slow_admin_statements= OFF;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+0
+SET GLOBAL log_slow_admin_statements= -0;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+0
+SET GLOBAL log_slow_admin_statements= 0.00;
+ERROR 42000: Incorrect argument type to variable 'log_slow_admin_statements'
+SET GLOBAL log_slow_admin_statements= +0;
+SELECT @@global.log_slow_admin_statements;
+@@global.log_slow_admin_statements
+0
+SET @@global.log_slow_admin_statements= 'DEFAULT';
+ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of 'DEFAULT'
+SET @@global.log_slow_admin_statements= 'true';
+ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of 'true'
+SET @@global.log_slow_admin_statements= BLABLA;
+ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of 'BLABLA'
+SET @@global.log_slow_admin_statements= 25;
+ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of '25'
+SET GLOBAL log_slow_admin_statements= -1;
+ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of '-1'
+SET @badvar= 'true';
+SET @@global.log_slow_admin_statements= @badvar;
+ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of 'true'
+SET GLOBAL log_slow_admin_statements= 'DEFAULT';
+ERROR 42000: Variable 'log_slow_admin_statements' can't be set to the value of 'DEFAULT'
+SET log_slow_admin_statements= TRUE;
+ERROR HY000: Variable 'log_slow_admin_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET SESSION log_slow_admin_statements= TRUE;
+ERROR HY000: Variable 'log_slow_admin_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.log_slow_admin_statements= TRUE;
+ERROR HY000: Variable 'log_slow_admin_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET LOCAL log_slow_admin_statements= TRUE;
+ERROR HY000: Variable 'log_slow_admin_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@global log_slow_admin_statements= TRUE;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_slow_admin_statements= TRUE' at line 1
+SET @@SESSION log_slow_admin_statements= TRUE;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_slow_admin_statements= TRUE' at line 1
+SET @@global.log_slow_admin_statements= @start_value;

=== added file 'mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result'
--- a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result	revid:mark.leith@stripped
@@ -0,0 +1,34 @@
+SET @old_log_output=                @@global.log_output;
+SET @old_slow_query_log=            @@global.slow_query_log;
+SET @old_long_query_time=           @@session.long_query_time;
+SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements;
+USE test;
+CREATE TABLE log_slow_admin_statements (
+i INT PRIMARY KEY,
+j INT
+);
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+SET SESSION long_query_time = 0;
+SET GLOBAL log_slow_admin_statements = on;
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT;
+INSERT INTO log_slow_admin_statements VALUES (1,2,3), (4,5,6);
+OPTIMIZE TABLE log_slow_admin_statements;
+Table	Op	Msg_type	Msg_text
+test.log_slow_admin_statements	optimize	status	OK
+INSERT INTO log_slow_admin_statements VALUES (7,8,9), (10,11,12);
+ANALYZE TABLE log_slow_admin_statements;
+Table	Op	Msg_type	Msg_text
+test.log_slow_admin_statements	analyze	status	OK
+DROP TABLE log_slow_admin_statements;
+SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%';
+sql_text
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT
+OPTIMIZE TABLE log_slow_admin_statements
+ANALYZE TABLE log_slow_admin_statements
+DROP TABLE log_slow_admin_statements
+SET @@global.log_output=                @old_log_output;
+SET @@global.slow_query_log=            @old_slow_query_log;
+SET @@session.long_query_time=          @old_long_query_time;
+SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
+TRUNCATE TABLE mysql.slow_log;

=== added file 'mysql-test/suite/sys_vars/r/log_slow_slave_statements_basic.result'
--- a/mysql-test/suite/sys_vars/r/log_slow_slave_statements_basic.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/r/log_slow_slave_statements_basic.result	revid:mark.leith@stripped
@@ -0,0 +1,76 @@
+SET @start_value= @@global.log_slow_slave_statements;
+SET @@global.log_slow_slave_statements= DEFAULT;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+0
+SET @@global.log_slow_slave_statements= TRUE;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+1
+SET @@global.log_slow_slave_statements= true;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+1
+SET @@global.log_slow_slave_statements= 0;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+0
+SET @@global.log_slow_slave_statements= 1;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+1
+SET @goodvar= TRUE;
+SET @@global.log_slow_slave_statements= @goodvar;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+1
+SET GLOBAL log_slow_slave_statements= DEFAULT;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+0
+SET GLOBAL log_slow_slave_statements= ON;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+1
+SET GLOBAL log_slow_slave_statements= OFF;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+0
+SET GLOBAL log_slow_slave_statements= -0;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+0
+SET GLOBAL log_slow_slave_statements= 0.00;
+ERROR 42000: Incorrect argument type to variable 'log_slow_slave_statements'
+SET GLOBAL log_slow_slave_statements= +0;
+SELECT @@global.log_slow_slave_statements;
+@@global.log_slow_slave_statements
+0
+SET @@global.log_slow_slave_statements= 'DEFAULT';
+ERROR 42000: Variable 'log_slow_slave_statements' can't be set to the value of 'DEFAULT'
+SET @@global.log_slow_slave_statements= 'true';
+ERROR 42000: Variable 'log_slow_slave_statements' can't be set to the value of 'true'
+SET @@global.log_slow_slave_statements= BLABLA;
+ERROR 42000: Variable 'log_slow_slave_statements' can't be set to the value of 'BLABLA'
+SET @@global.log_slow_slave_statements= 25;
+ERROR 42000: Variable 'log_slow_slave_statements' can't be set to the value of '25'
+SET GLOBAL log_slow_slave_statements= -1;
+ERROR 42000: Variable 'log_slow_slave_statements' can't be set to the value of '-1'
+SET @badvar= 'true';
+SET @@global.log_slow_slave_statements= @badvar;
+ERROR 42000: Variable 'log_slow_slave_statements' can't be set to the value of 'true'
+SET GLOBAL log_slow_slave_statements= 'DEFAULT';
+ERROR 42000: Variable 'log_slow_slave_statements' can't be set to the value of 'DEFAULT'
+SET log_slow_slave_statements= TRUE;
+ERROR HY000: Variable 'log_slow_slave_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET SESSION log_slow_slave_statements= TRUE;
+ERROR HY000: Variable 'log_slow_slave_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@session.log_slow_slave_statements= TRUE;
+ERROR HY000: Variable 'log_slow_slave_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET LOCAL log_slow_slave_statements= TRUE;
+ERROR HY000: Variable 'log_slow_slave_statements' is a GLOBAL variable and should be set with SET GLOBAL
+SET @@global log_slow_slave_statements= TRUE;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_slow_slave_statements= TRUE' at line 1
+SET @@SESSION log_slow_slave_statements= TRUE;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'log_slow_slave_statements= TRUE' at line 1
+SET @@global.log_slow_slave_statements= @start_value;

=== added file 'mysql-test/suite/sys_vars/t/log_slow_admin_statements_basic.test'
--- a/mysql-test/suite/sys_vars/t/log_slow_admin_statements_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_basic.test	revid:mark.leith@stripped
@@ -0,0 +1,110 @@
+################## mysql-test\t\log_slow_admin_statements_basic.test ######
+#                                                                             #
+# Variable Name: log_slow_admin_statements                                    #
+# Scope: Global                                                               #
+# Access Type: Static                                                         #
+# Data Type:                                                                  #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2013-02-05                                                   #
+# Author : Mark Leith                                                         #
+#                                                                             #
+# Description:Test Cases of Dynamic System Variable                           #
+#             log_slow_admin_statements                                       #
+#             that checks the behavior of this variable in the following ways #
+#              * Value Check                                                  #
+#              * Scope Check                                                  #
+#                                                                             #
+# Reference:                                                                  #
+#  http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html        #
+#                                                                             #
+###############################################################################
+
+SET @start_value= @@global.log_slow_admin_statements;
+
+####################################################################
+#   Valid values for boolean                                       #
+####################################################################
+SET @@global.log_slow_admin_statements= DEFAULT;
+SELECT @@global.log_slow_admin_statements;
+
+SET @@global.log_slow_admin_statements= TRUE;
+SELECT @@global.log_slow_admin_statements;
+
+SET @@global.log_slow_admin_statements= true;
+SELECT @@global.log_slow_admin_statements;
+
+SET @@global.log_slow_admin_statements= 0;
+SELECT @@global.log_slow_admin_statements;
+
+SET @@global.log_slow_admin_statements= 1;
+SELECT @@global.log_slow_admin_statements;
+
+SET @goodvar= TRUE;
+SET @@global.log_slow_admin_statements= @goodvar;
+SELECT @@global.log_slow_admin_statements;
+
+SET GLOBAL log_slow_admin_statements= DEFAULT;
+SELECT @@global.log_slow_admin_statements;
+
+SET GLOBAL log_slow_admin_statements= ON;
+SELECT @@global.log_slow_admin_statements;
+
+SET GLOBAL log_slow_admin_statements= OFF;
+SELECT @@global.log_slow_admin_statements;
+
+SET GLOBAL log_slow_admin_statements= -0;
+SELECT @@global.log_slow_admin_statements;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL log_slow_admin_statements= 0.00;
+
+SET GLOBAL log_slow_admin_statements= +0;
+SELECT @@global.log_slow_admin_statements;
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_admin_statements= 'DEFAULT';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_admin_statements= 'true';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_admin_statements= BLABLA;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_admin_statements= 25;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_slow_admin_statements= -1;
+
+SET @badvar= 'true';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_admin_statements= @badvar;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_slow_admin_statements= 'DEFAULT';
+
+--error ER_GLOBAL_VARIABLE
+SET log_slow_admin_statements= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET SESSION log_slow_admin_statements= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET @@session.log_slow_admin_statements= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET LOCAL log_slow_admin_statements= TRUE;
+
+--error ER_PARSE_ERROR
+SET @@global log_slow_admin_statements= TRUE;
+
+--error ER_PARSE_ERROR
+SET @@SESSION log_slow_admin_statements= TRUE;
+
+SET @@global.log_slow_admin_statements= @start_value;
+

=== added file 'mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test'
--- a/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/log_slow_admin_statements_func.test	revid:mark.leith@stripped
@@ -0,0 +1,41 @@
+# check that CSV engine was compiled in
+--source include/have_csv.inc
+
+SET @old_log_output=                @@global.log_output;
+SET @old_slow_query_log=            @@global.slow_query_log;
+SET @old_long_query_time=           @@session.long_query_time;
+SET @old_log_slow_admin_statements= @@global.log_slow_admin_statements;
+
+USE test;
+CREATE TABLE log_slow_admin_statements (
+	i INT PRIMARY KEY,
+	j INT
+);
+
+# enable slow logging to table
+SET GLOBAL log_output = 'file,table';
+SET GLOBAL slow_query_log = on;
+SET SESSION long_query_time = 0;
+SET GLOBAL log_slow_admin_statements = on;
+
+# test ALTER, OPTIMIZE and ANALYZE against the table show up
+ALTER TABLE log_slow_admin_statements ADD COLUMN k INT;
+
+# add some rows so OPTIMIZE runs
+INSERT INTO log_slow_admin_statements VALUES (1,2,3), (4,5,6);
+OPTIMIZE TABLE log_slow_admin_statements;
+
+# and again so ANALYZE runs
+INSERT INTO log_slow_admin_statements VALUES (7,8,9), (10,11,12);
+ANALYZE TABLE log_slow_admin_statements;
+
+DROP TABLE log_slow_admin_statements;
+
+SELECT sql_text FROM mysql.slow_log WHERE sql_text LIKE '%TABLE log_slow_admin_statements%';
+
+SET @@global.log_output=                @old_log_output;
+SET @@global.slow_query_log=            @old_slow_query_log;
+SET @@session.long_query_time=          @old_long_query_time;
+SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements;
+
+TRUNCATE TABLE mysql.slow_log;

=== added file 'mysql-test/suite/sys_vars/t/log_slow_slave_statements_basic.test'
--- a/mysql-test/suite/sys_vars/t/log_slow_slave_statements_basic.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/sys_vars/t/log_slow_slave_statements_basic.test	revid:mark.leith@stripped
@@ -0,0 +1,110 @@
+################## mysql-test\t\log_slow_slave_statements_basic.test ######
+#                                                                             #
+# Variable Name: log_slow_slave_statements                                    #
+# Scope: Global                                                               #
+# Access Type: Static                                                         #
+# Data Type:                                                                  #
+#                                                                             #
+#                                                                             #
+# Creation Date: 2013-02-05                                                   #
+# Author : Mark Leith                                                         #
+#                                                                             #
+# Description:Test Cases of Dynamic System Variable                           #
+#             log_slow_slave_statements                                       #
+#             that checks the behavior of this variable in the following ways #
+#              * Value Check                                                  #
+#              * Scope Check                                                  #
+#                                                                             #
+# Reference:                                                                  #
+#  http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html        #
+#                                                                             #
+###############################################################################
+
+SET @start_value= @@global.log_slow_slave_statements;
+
+####################################################################
+#   Valid values for boolean                                       #
+####################################################################
+SET @@global.log_slow_slave_statements= DEFAULT;
+SELECT @@global.log_slow_slave_statements;
+
+SET @@global.log_slow_slave_statements= TRUE;
+SELECT @@global.log_slow_slave_statements;
+
+SET @@global.log_slow_slave_statements= true;
+SELECT @@global.log_slow_slave_statements;
+
+SET @@global.log_slow_slave_statements= 0;
+SELECT @@global.log_slow_slave_statements;
+
+SET @@global.log_slow_slave_statements= 1;
+SELECT @@global.log_slow_slave_statements;
+
+SET @goodvar= TRUE;
+SET @@global.log_slow_slave_statements= @goodvar;
+SELECT @@global.log_slow_slave_statements;
+
+SET GLOBAL log_slow_slave_statements= DEFAULT;
+SELECT @@global.log_slow_slave_statements;
+
+SET GLOBAL log_slow_slave_statements= ON;
+SELECT @@global.log_slow_slave_statements;
+
+SET GLOBAL log_slow_slave_statements= OFF;
+SELECT @@global.log_slow_slave_statements;
+
+SET GLOBAL log_slow_slave_statements= -0;
+SELECT @@global.log_slow_slave_statements;
+
+--error ER_WRONG_TYPE_FOR_VAR
+SET GLOBAL log_slow_slave_statements= 0.00;
+
+SET GLOBAL log_slow_slave_statements= +0;
+SELECT @@global.log_slow_slave_statements;
+
+#################################################################
+# Check if the value in GLOBAL Table matches value in variable  #
+#################################################################
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_slave_statements= 'DEFAULT';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_slave_statements= 'true';
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_slave_statements= BLABLA;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_slave_statements= 25;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_slow_slave_statements= -1;
+
+SET @badvar= 'true';
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.log_slow_slave_statements= @badvar;
+
+--error ER_WRONG_VALUE_FOR_VAR
+SET GLOBAL log_slow_slave_statements= 'DEFAULT';
+
+--error ER_GLOBAL_VARIABLE
+SET log_slow_slave_statements= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET SESSION log_slow_slave_statements= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET @@session.log_slow_slave_statements= TRUE;
+
+--error ER_GLOBAL_VARIABLE
+SET LOCAL log_slow_slave_statements= TRUE;
+
+--error ER_PARSE_ERROR
+SET @@global log_slow_slave_statements= TRUE;
+
+--error ER_PARSE_ERROR
+SET @@SESSION log_slow_slave_statements= TRUE;
+
+SET @@global.log_slow_slave_statements= @start_value;
+

=== modified file 'mysql-test/t/variables.test'
--- a/mysql-test/t/variables.test	revid:anitha.gopi@stripped
+++ b/mysql-test/t/variables.test	revid:mark.leith@stripped
@@ -1527,3 +1527,28 @@
 
 --error ER_WRONG_VALUE_FOR_VAR
 SET @@sql_mode= 4294967296;
+
+--echo #
+--echo # Bug #59860: log-slow-admin-statements and log-slow-slave-statements not displayed
+--echo #
+
+# Basic testing to check that each variable shows up and can be
+# altered. 
+#
+# Functional testing of log_slow_admin_statements is within
+# suites/sys_vars/t/log_slow_admin_statements_basic.test
+# suites/sys_vars/t/log_slow_admin_statements_func.test
+#
+# Functional testing of log_slow_slave_statements is within
+# suites/sys_vars/t/log_slow_slave_statements_basic.test
+# suites/rpl/t/rpl_slow_query_log.test
+
+show variables like 'log_slow%';
+set global log_slow_admin_statements = on;
+show global variables like 'log_slow_admin_statements';
+select * from information_schema.global_variables where variable_name like 'log_slow_admin_statements';
+set global log_slow_slave_statements = on;
+show global variables like 'log_slow_slave_statements';
+select * from information_schema.global_variables where variable_name like 'log_slow_slave_statements';
+set global log_slow_admin_statements = default;
+set global log_slow_slave_statements = default;

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	revid:anitha.gopi@stripped
+++ b/sql/mysqld.cc	revid:mark.leith@stripped
@@ -6969,14 +6969,6 @@
    "Don't log extra information to update and slow-query logs.",
    &opt_short_log_format, &opt_short_log_format,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"log-slow-admin-statements", 0,
-   "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to "
-   "the slow log if it is open.", &opt_log_slow_admin_statements,
-   &opt_log_slow_admin_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
- {"log-slow-slave-statements", 0,
-  "Log slow statements executed by slave thread to the slow log if it is open.",
-  &opt_log_slow_slave_statements, &opt_log_slow_slave_statements,
-  0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
   {"log-tc", 0,
    "Path to transaction coordinator log (used for transactions that affect "
    "more than one storage engine, when binary log is disabled).",

=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	revid:anitha.gopi@stripped
+++ b/sql/sys_vars.cc	revid:mark.leith@stripped
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2011, 2012 Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1526,6 +1526,19 @@
        GLOBAL_VAR(opt_log_queries_not_using_indexes),
        CMD_LINE(OPT_ARG), DEFAULT(FALSE));
 
+static Sys_var_mybool Sys_log_slow_admin_statements(
+       "log_slow_admin_statements",
+       "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to "
+       "the slow log if it is open.",
+       GLOBAL_VAR(opt_log_slow_admin_statements),
+       CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
+static Sys_var_mybool Sys_log_slow_slave_statements(
+       "log_slow_slave_statements",
+       "Log slow statements executed by slave thread to the slow log if it is open.",
+       GLOBAL_VAR(opt_log_slow_slave_statements),
+       CMD_LINE(OPT_ARG), DEFAULT(FALSE));
+
 static bool update_log_throttle_queries_not_using_indexes(sys_var *self,
                                                           THD *thd,
                                                           enum_var_type type)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6 branch (mark.leith:4747 to 4748) Bug#11766693Mark Leith3 Apr