List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:March 18 2009 5:11pm
Subject:bzr commit into mysql-5.1-bugteam branch (alfranio.correia:2842)
Bug#40146
View as plain text  
#At file:///home/acorreia/workspace.sun/repository.mysql/bzrwork/bug-40146/mysql-5.1-bugteam/ based on revid:alfranio.correia@stripped

 2842 Alfranio Correia	2009-03-18
      BUG#40146 log_slave_updates uses MIXED mode for binlog regardless of binlog_format
      
      Added test case.
added:
  mysql-test/suite/rpl/r/rpl_slave_session.result
  mysql-test/suite/rpl/t/rpl_slave_session.test

=== added file 'mysql-test/suite/rpl/r/rpl_slave_session.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_session.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_session.result	2009-03-18 17:11:39 +0000
@@ -0,0 +1,98 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+SET @restore_wait_timeout=@@global.wait_timeout;
+SET @restore_binlog_format=@@global.binlog_format;
+STOP SLAVE;
+SET GLOBAL binlog_format="statement";
+SET @@GLOBAL.binlog_format="statement";
+SET SESSION binlog_format="statement";
+SET @@SESSION.binlog_format="statement";
+SET LOCAL binlog_format="statement";
+SET @@LOCAL.binlog_format="statement";
+SET @@binlog_format="statement";
+SET binlog_format="statement";
+SET RUNNING_SLAVE binlog_format="statement";
+ERROR HY000: This operation requires a running slave; configure slave and do START SLAVE
+SHOW GLOBAL VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW GLOBAL VARIABLES where variable_name like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW GLOBAL VARIABLES where value like "statement";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW SESSION VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW SESSION VARIABLES where variable_name like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW SESSION VARIABLES where value like "statement";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+ERROR HY000: This operation requires a running slave; configure slave and do START SLAVE
+SHOW RUNNING_SLAVE VARIABLES where variable_name like "binlog_format";
+ERROR HY000: This operation requires a running slave; configure slave and do START SLAVE
+SHOW RUNNING_SLAVE VARIABLES where value like "statement";
+ERROR HY000: This operation requires a running slave; configure slave and do START SLAVE
+START SLAVE;
+SET RUNNING_SLAVE binlog_format="statement";
+SHOW GLOBAL VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW SESSION VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW RUNNING_SLAVE VARIABLES where variable_name like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW RUNNING_SLAVE VARIABLES where value like "statement";
+Variable_name	Value
+binlog_format	STATEMENT
+SET RUNNING_SLAVE binlog_format="row";
+SHOW GLOBAL VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW SESSION VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	ROW
+SHOW RUNNING_SLAVE VARIABLES where variable_name like "binlog_format";
+Variable_name	Value
+binlog_format	ROW
+SHOW RUNNING_SLAVE VARIABLES where value like "row";
+Variable_name	Value
+binlog_format	ROW
+GRANT ALL PRIVILEGES ON *.* TO 'user_priv'@'localhost';
+REVOKE SUPER ON *.* FROM 'user_priv'@'localhost';
+SHOW GLOBAL VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW SESSION VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	STATEMENT
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+Variable_name	Value
+binlog_format	ROW
+SET GLOBAL binlog_format="row";
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
+SET SESSION binlog_format="row";
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
+SET GLOBAL wait_timeout=10;
+ERROR 42000: Access denied; you need the SUPER privilege for this operation
+SET SESSION wait_timeout=10;
+SET RUNNING_SLAVE wait_timeout=10;
+SET @@global.wait_timeout=@restore_wait_timeout;
+SET @@global.binlog_format=@restore_binlog_format;
+DROP USER 'user_priv'@'localhost';

=== added file 'mysql-test/suite/rpl/t/rpl_slave_session.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_session.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_session.test	2009-03-18 17:11:39 +0000
@@ -0,0 +1,95 @@
+#########################################################################################
+##  Tests the ability to change the variables in the SQL Thread from a different
+#   session/thread.
+#########################################################################################
+
+#########################################################################################
+##                                Configuring the environment
+#########################################################################################
+-- source include/not_embedded.inc
+-- source include/master-slave.inc
+-- source include/have_binlog_format_mixed.inc
+
+connection slave;
+SET @restore_wait_timeout=@@global.wait_timeout;
+SET @restore_binlog_format=@@global.binlog_format;
+#########################################################################################
+##                       Stop the SLAVE and Check the binlog_format
+#########################################################################################
+connection slave;
+STOP SLAVE;
+
+SET GLOBAL binlog_format="statement";
+SET @@GLOBAL.binlog_format="statement";
+SET SESSION binlog_format="statement";
+SET @@SESSION.binlog_format="statement";
+SET LOCAL binlog_format="statement";
+SET @@LOCAL.binlog_format="statement";
+SET @@binlog_format="statement";
+SET binlog_format="statement";
+--error 1199
+SET RUNNING_SLAVE binlog_format="statement";
+
+SHOW GLOBAL VARIABLES like "binlog_format";
+SHOW GLOBAL VARIABLES where variable_name like "binlog_format";
+SHOW GLOBAL VARIABLES where value like "statement";
+SHOW SESSION VARIABLES like "binlog_format";
+SHOW SESSION VARIABLES where variable_name like "binlog_format";
+SHOW SESSION VARIABLES where value like "statement";
+--error 1199
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+--error 1199
+SHOW RUNNING_SLAVE VARIABLES where variable_name like "binlog_format";
+--error 1199
+SHOW RUNNING_SLAVE VARIABLES where value like "statement";
+
+#########################################################################################
+##                       Start the SLAVE and Check the binlog_format
+#########################################################################################
+START SLAVE;
+SET RUNNING_SLAVE binlog_format="statement";
+
+SHOW GLOBAL VARIABLES like "binlog_format";
+SHOW SESSION VARIABLES like "binlog_format";
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+SHOW RUNNING_SLAVE VARIABLES where variable_name like "binlog_format";
+SHOW RUNNING_SLAVE VARIABLES where value like "statement";
+
+SET RUNNING_SLAVE binlog_format="row";
+
+SHOW GLOBAL VARIABLES like "binlog_format";
+SHOW SESSION VARIABLES like "binlog_format";
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+SHOW RUNNING_SLAVE VARIABLES where variable_name like "binlog_format";
+SHOW RUNNING_SLAVE VARIABLES where value like "row";
+
+#########################################################################################
+##                       Start the SLAVE and Check the binlog_format
+#########################################################################################
+GRANT ALL PRIVILEGES ON *.* TO 'user_priv'@'localhost';
+REVOKE SUPER ON *.* FROM 'user_priv'@'localhost';
+connect (conn_user_priv, LOCALHOST, user_priv,, test,$SLAVE_MYPORT);
+
+connection conn_user_priv;
+
+SHOW GLOBAL VARIABLES like "binlog_format";
+SHOW SESSION VARIABLES like "binlog_format";
+SHOW RUNNING_SLAVE VARIABLES like "binlog_format";
+--error 1227
+SET GLOBAL binlog_format="row";
+--error 1227
+SET SESSION binlog_format="row";
+
+--error 1227
+SET GLOBAL wait_timeout=10;
+SET SESSION wait_timeout=10;
+SET RUNNING_SLAVE wait_timeout=10;
+#########################################################################################
+##                                     Clean up
+#########################################################################################
+connection slave;
+
+SET @@global.wait_timeout=@restore_wait_timeout;
+SET @@global.binlog_format=@restore_binlog_format;
+
+DROP USER 'user_priv'@'localhost';

Thread
bzr commit into mysql-5.1-bugteam branch (alfranio.correia:2842)Bug#40146Alfranio Correia18 Mar