Commit c6978028 authored by Sven Sandberg's avatar Sven Sandberg

local merge in 5.1-rpl

parents a49577cc 78c8bfdd
...@@ -497,7 +497,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), ...@@ -497,7 +497,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
--echo ******************************************** --echo ********************************************
--echo --echo
connection slave; connection slave;
wait_for_slave_to_stop; source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
...@@ -554,7 +554,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), ...@@ -554,7 +554,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
--echo ******************************************** --echo ********************************************
--echo --echo
connection slave; connection slave;
wait_for_slave_to_stop; source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
...@@ -697,7 +697,7 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; ...@@ -697,7 +697,7 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1;
# Remove below once fixed # Remove below once fixed
#*************************** #***************************
connection slave; connection slave;
wait_for_slave_to_stop; source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
...@@ -763,7 +763,7 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; ...@@ -763,7 +763,7 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1;
--echo ******************************************** --echo ********************************************
--echo --echo
connection slave; connection slave;
wait_for_slave_to_stop; source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
...@@ -840,7 +840,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; ...@@ -840,7 +840,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1;
--echo ***************** --echo *****************
--echo --echo
connection slave; connection slave;
wait_for_slave_to_stop; source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
......
...@@ -94,7 +94,7 @@ SELECT * FROM t2 ORDER BY a; ...@@ -94,7 +94,7 @@ SELECT * FROM t2 ORDER BY a;
--echo *** Start Slave *** --echo *** Start Slave ***
connection slave; connection slave;
START SLAVE; START SLAVE;
wait_for_slave_to_stop; source include/wait_for_slave_sql_to_stop.inc;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
--query_vertical SHOW SLAVE STATUS --query_vertical SHOW SLAVE STATUS
...@@ -429,6 +429,7 @@ set @b1 = 'b1b1b1b1'; ...@@ -429,6 +429,7 @@ set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1); set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
connection slave;
--source include/wait_for_slave_sql_to_stop.inc --source include/wait_for_slave_sql_to_stop.inc
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
......
...@@ -9,10 +9,8 @@ ...@@ -9,10 +9,8 @@
# test the slave immediately writes DROP TEMPORARY TABLE this_old_table). # test the slave immediately writes DROP TEMPORARY TABLE this_old_table).
# We wait for the slave to have written all he wants to the binlog # We wait for the slave to have written all he wants to the binlog
# (otherwise RESET MASTER may come too early). # (otherwise RESET MASTER may come too early).
save_master_pos; sync_slave_with_master;
connection slave; source include/stop_slave.inc;
sync_with_master;
stop slave;
reset master; reset master;
reset slave; reset slave;
# We are going to read the slave's binlog which contains file_id (for some LOAD # We are going to read the slave's binlog which contains file_id (for some LOAD
...@@ -81,17 +79,14 @@ select * from t1 order by 1 asc; ...@@ -81,17 +79,14 @@ select * from t1 order by 1 asc;
save_master_pos; save_master_pos;
connection slave; connection slave;
# Note that the above 'slave start' will cause a 3rd rotate event (a fake one) source include/start_slave.inc;
# to go into the relay log (the master always sends a fake one when replication
# starts).
start slave;
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%';
--source include/wait_slave_status.inc
sync_with_master; sync_with_master;
#check t1 on slave to ensure whether it's identical with on master #check t1 on slave to ensure whether it's identical with on master
select * from t1 order by 1 asc; select * from t1 order by 1 asc;
flush logs; flush logs;
stop slave; source include/stop_slave.inc;
source include/start_slave.inc;
connection master; connection master;
# Create some entries for second log # Create some entries for second log
...@@ -104,10 +99,7 @@ source include/show_binlog_events.inc; ...@@ -104,10 +99,7 @@ source include/show_binlog_events.inc;
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000002'; show binlog events in 'master-bin.000002';
show binary logs; show binary logs;
save_master_pos; sync_slave_with_master;
connection slave;
start slave;
sync_with_master;
show binary logs; show binary logs;
--replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION --replace_result $MASTER_MYPORT MASTER_PORT $VERSION VERSION
--replace_column 2 # 5 # --replace_column 2 # 5 #
......
--echo **** Resetting master and slave **** --echo **** Resetting master and slave ****
connection slave; connection slave;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
RESET SLAVE; RESET SLAVE;
connection master; connection master;
RESET MASTER; RESET MASTER;
connection slave; connection slave;
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
...@@ -7,19 +7,30 @@ ...@@ -7,19 +7,30 @@
# #
# ==== Usage ==== # ==== Usage ====
# #
# source include/sync_slave_io_with_master.inc;
#
# Syncs to the current position on master, as found by SHOW MASTER # Syncs to the current position on master, as found by SHOW MASTER
# STATUS. # STATUS.
# #
# Must be called on the master. # Must be called on the master. Will change connection to the slave.
#
# Parameters to this macro are $slave_timeout and
# $slave_keep_connection. See wait_for_slave_param.inc for
# descriptions.
let $_master_file= query_get_value("SHOW MASTER STATUS", File, 1); let $_master_file= query_get_value("SHOW MASTER STATUS", File, 1);
let $_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1); let $_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1);
connection slave; connection slave;
let $slave_error_message= Failed while waiting for slave IO thread to sync;
let $slave_param= Master_Log_File; let $slave_param= Master_Log_File;
let $slave_param_value= $_master_file; let $slave_param_value= $_master_file;
source include/wait_for_slave_param.inc; source include/wait_for_slave_param.inc;
let $slave_param= Read_Master_Log_Pos; let $slave_param= Read_Master_Log_Pos;
let $slave_param_value= $_master_pos; let $slave_param_value= $_master_pos;
source include/wait_for_slave_param.inc; source include/wait_for_slave_param.inc;
let $slave_error_message= ;
################################################### # ==== Purpose ====
#Author: Jeb #
#Date: 2007-06-11 # Waits until the IO thread of the current connection has stopped, or
#Purpose: used for io errors on the slave. If Slave gets an io # until a timeout is reached.
# error, the io trhead should stop #
#Details: # ==== Usage ====
# 1) Fill in and setup variables #
# 2) loop through looking for # source include/wait_for_slave_io_to_stop.inc;
# sql threads to stop #
# 3) If loops too long die. # Parameters to this macro are $slave_timeout and
#################################################### # $slave_keep_connection. See wait_for_slave_param.inc for
connection slave; # descriptions.
let $my_show= SHOW SLAVE STATUS;
let $sql_running= Slave_IO_Running;
let $row_number= 1;
let $run= 1;
let $counter= 300;
while ($run)
{
let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
if (`SELECT '$io_result' = 'No'`){
let $run= 0;
}
sleep 0.1;
if (!$counter){
--echo "Failed while waiting for slave IO thread to stop"
query_vertical SHOW SLAVE STATUS;
exit;
}
dec $counter;
}
let $slave_param= Slave_IO_Running;
let $slave_param_value= No;
let $slave_error_message= Failed while waiting for slave IO thread to stop;
source include/wait_for_slave_param.inc;
let $slave_error_message= ;
# include/wait_for_slave_param.inc # ==== Purpose ====
# #
# SUMMARY # Waits until SHOW SLAVE STATUS has returned a specified value, or
# until a timeout is reached.
# #
# Waits until SHOW SLAVE STATUS has returned a spicified value. # ==== Usage ====
#
# USAGE
# #
# let $slave_param= Slave_SQL_Running; # let $slave_param= Slave_SQL_Running;
# let $slave_param_value= No; # let $slave_param_value= No;
# --source include/slave_wait_param.inc # --source include/slave_wait_param.inc
#
# Parameters:
#
# $slave_param, $slave_param_value
# This macro will wait until the column of the output of SHOW SLAVE
# STATUS named $slave_param gets the value $slave_param_value. See
# the example above.
#
# $slave_param_comparison
# By default, this file waits until $slave_param becomes equal to
# $slave_param_value. If you want to wait until $slave_param
# becomes *unequal* to $slave_param_value, set this parameter to the
# string '!=', like this:
# let $slave_param_comparison= !=;
#
# $slave_timeout
# The default timeout is 5 minutes. You can change the timeout by
# setting $slave_timeout. The unit is tenths of seconds.
#
# $slave_keep_connection
# If the timeout is reached, debug info is given by calling SHOW
# SLAVE STATUS, SHOW PROCESSLIST, and SHOW BINLOG EVENTS. By
# default (assuming the current connection is slave), a 'connection
# master' is then issued, and the same information is printed again
# on the master host. You can avoid switching to master (and thus
# suppress debug info on master too) by setting
# $slave_keep_connection to 1.
#
# $slave_error_message
# If set, this is printed when a timeout occurs. This is primarily
# intended to be used by other wait_for_slave_* macros, to indicate
# what the purpose of the wait was. (A very similar error message is
# given by default, but the wait_for_slave_* macros use this to give
# an error message identical to that in previous versions, so that
# errors are easier searchable in the pushbuild history.)
let $_slave_timeout_counter= $slave_timeout;
if (!$_slave_timeout_counter)
{
let $_slave_timeout_counter= 3000;
}
let $slave_wait_param_counter= 300; let $_slave_param_comparison= $slave_param_comparison;
let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1); if (`SELECT '$_slave_param_comparison' = ''`)
while (`select "$slave_value" != "$slave_param_value"`)
{ {
dec $slave_wait_param_counter; let $_slave_param_comparison= =;
if (!$slave_wait_param_counter) }
let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
while (`SELECT NOT('$_show_slave_status_value' $_slave_param_comparison '$slave_param_value')`)
{
if (!$_slave_timeout_counter)
{
--echo **** ERROR: failed while waiting for slave parameter $slave_param $_slave_param_comparison $slave_param_value ****
if (`SELECT '$slave_error_message' != ''`)
{ {
--echo ERROR: failed while waiting for slave parameter $slave_param: $slave_param_value --echo Message: $slave_error_message
query_vertical show slave status; }
--echo Note: the following output may have changed since the failure was detected
--echo **** Showing SLAVE STATUS, PROCESSLIST, and BINLOG EVENTS on slave ****
query_vertical SHOW SLAVE STATUS;
SHOW PROCESSLIST;
let $binlog_name= query_get_value("SHOW MASTER STATUS", File, 1);
eval SHOW BINLOG EVENTS IN '$binlog_name';
if (!$slave_keep_connection) {
let $master_binlog_name_io= query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
let $master_binlog_name_sql= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1);
--echo **** Showing MASTER STATUS, PROCESSLIST, and BINLOG EVENTS on master ****
--echo [on master]
connection master;
query_vertical SHOW MASTER STATUS;
SHOW PROCESSLIST;
eval SHOW BINLOG EVENTS IN '$master_binlog_name_sql';
if (`SELECT '$master_binlog_name_io' != '$master_binlog_name_sql'`)
{
eval SHOW BINLOG EVENTS IN '$master_binlog_name_io';
}
}
exit; exit;
} }
dec $_slave_timeout_counter;
sleep 0.1; sleep 0.1;
let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1); let $_show_slave_status_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
} }
################################################### # ==== Purpose ====
#Author: Sven #
#Date: 2007-10-09 # Waits until the SQL thread of the current connection has got an
#Purpose: Wait until the slave has an error in the # error, or until a timeout is reached.
# sql thread, as indicated by #
# "SHOW SLAVE STATUS", or at most 30 # ==== Usage ====
# seconds. #
#Details: # source include/wait_for_slave_sql_error.inc;
# 1) Fill in and setup variables #
# 2) loop, looking for sql error on slave # Parameters to this macro are $slave_timeout and
# 3) If it loops too long, die. # $slave_keep_connection. See wait_for_slave_param.inc for
#################################################### # descriptions.
connection slave;
let $row_number= 1;
let $run= 1;
let $counter= 300;
while ($run) let $old_slave_param_comparison= $slave_param_comparison;
{
let $sql_result= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, $row_number); let $slave_param= Last_SQL_Errno;
let $run= `SELECT '$sql_result' = '0'`; let $slave_param_comparison= !=;
if ($run) { let $slave_param_value= 0;
real_sleep 0.1; let $slave_error_message= Failed while waiting for slave to produce an error in its sql thread;
if (!$counter){ source include/wait_for_slave_param.inc;
--echo "Failed while waiting for slave to produce an error in its sql thread" let $slave_error_message= ;
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # let $slave_param_comparison= $old_slave_param_comparison;
query_vertical SHOW SLAVE STATUS;
exit;
}
dec $counter;
}
}
################################################### # ==== Purpose ====
#Author: Mats (based on file written by Jeb) #
#Date: 2008-05-06 # Waits the SQL thread of the current connection has started, or until
#Purpose: To wait for slave SQL thread to start # a timeout is reached.
#Details: #
# 1) Fill in and setup variables # ==== Usage ====
# 2) loop through looking for both #
# io and sql threads to start # source include/wait_for_slave_sql_to_start.inc;
# 3) If loops too long die. #
#################################################### # Parameters to this macro are $slave_timeout and
connection slave; # $slave_keep_connection. See wait_for_slave_param.inc for
let $row_number= 1; # descriptions.
let $run= 1;
let $counter= 300;
while ($run)
{
let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
if (`SELECT '$sql_result' = 'Yes'`){
let $run= 0;
}
sleep 0.1;
if (!$counter){
--echo "Failed while waiting for slave SQL to start"
query_vertical SHOW SLAVE STATUS;
exit;
}
dec $counter;
}
let $slave_param= Slave_SQL_Running;
let $slave_param_value= Yes;
let $slave_error_message= Failed while waiting for slave SQL to start;
source include/wait_for_slave_param.inc;
################################################### # ==== Purpose ====
#Author: Jeb
#Date: 2007-06-11
#Purpose: used for SQL errors on the slave. If Slave gets a sql
# error, the SQL trhead should stop
#Details:
# 1) Fill in and setup variables
# 2) loop through looking for
# sql threads to stop
# 3) If loops too long die.
# #
# INPUT: # Waits the SQL thread of the current connection has stopped, or until
# $timeout_counter Number of 1/10 sec to wait # a timeout is reached.
# $keep_connection Do not do any "connect" #
#################################################### # ==== Usage ====
if (!$keep_connection) #
{ # source include/wait_for_slave_sql_to_stop.inc;
connection slave; #
} # Parameters to this macro are $slave_timeout and
let $row_number= 1; # $slave_keep_connection. See wait_for_slave_param.inc for
let $run= 1; # descriptions.
let $counter = $timeout_counter;
if (!$counter)
{
let $counter= 3000;
}
while ($run) let $slave_param= Slave_SQL_Running;
{ let $slave_param_value= No;
if (!$keep_connection) let $slave_error_message= Failed while waiting for slave SQL thread to stop;
{ source include/wait_for_slave_param.inc;
if (!$counter) let $slave_error_message= ;
{
let $binlog_pos = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
let $binlog_file = query_get_value("SHOW SLAVE STATUS", Master_Log_File, 1);
}
}
let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
if (`SELECT '$sql_result' = 'No'`){
let $run= 0;
}
sleep 0.1;
if (!$counter){
--echo "Failed while waiting for slave SQL thread to stop"
if (!$keep_connection)
{
--echo [on master]
connection master;
--echo **** Note that the binlog positions are not read atomically: ****
--echo **** the replication might in reality have progressed further ****
eval SHOW BINLOG EVENTS IN '$binlog_file' FROM $binlog_pos LIMIT 5;
--echo [on slave]
connection slave;
}
--echo **** Note that the process list might have changed since the ****
--echo **** failure was detected ****
SHOW PROCESSLIST;
--echo **** Note that the binlog positions are not read atomically, so ****
--echo **** there is a small risk that the binlog status is incorrect ****
query_vertical SHOW SLAVE STATUS;
exit;
}
dec $counter;
}
################################################### # ==== Purpose ====
#Author: Jeb #
#Date: 2007-06-11 # Waits until both the IO and SQL threads of the current connection
#Purpose: To wait a brief time for slave to start # have started, or until a timeout is reached.
#Details: #
# 1) Fill in and setup variables # ==== Usage ====
# 2) loop through looking for both #
# io and sql threads to start # source include/wait_for_slave_to_start.inc;
# 3) If loops too long die. #
#################################################### # Parameters to this macro are $slave_timeout and
connection slave; # $slave_keep_connection. See wait_for_slave_param.inc for
let $row_number= 1; # descriptions.
let $run= 1;
let $counter= 300;
while ($run) let $slave_error_message= Failed while waiting for slave to start;
{
let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
if (`SELECT '$io_result' = 'Yes'`){
let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number); let $slave_param= Slave_IO_Running;
if (`SELECT '$sql_result' = 'Yes'`){ let $slave_param_value= Yes;
let $run= 0; source include/wait_for_slave_param.inc;
}
}
sleep 0.1;
if (!$counter){
--echo "Failed while waiting for slave to start"
query_vertical SHOW SLAVE STATUS;
exit;
}
dec $counter;
}
let $slave_param= Slave_SQL_Running;
let $slave_param_value= Yes;
source include/wait_for_slave_param.inc;
let $slave_error_message= ;
################################################### # ==== Purpose ====
#Author: Jeb #
#Date: 2007-06-11 # Waits until both the IO and SQL threads of the current connection
#Purpose: To replace the mysqltest.c executable # have stopped, or until a timeout is reached.
# wait_for_slave_to_stop function and #
# return this to the test language. # ==== Usage ====
#Details: #
# 1) Fill in and setup variables # source include/wait_for_slave_to_stop.inc;
# 2) loop through looking for both #
# io and sql threads to stop # Parameters to this macro are $slave_timeout and
# 3) If loops too long die. # $slave_keep_connection. See wait_for_slave_param.inc for
#################################################### # descriptions.
connection slave;
let $row_number= 1;
let $run= 1;
let $counter= 300;
while ($run) let $slave_error_message= Failed while waiting for slave to stop;
{
let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
if (`SELECT '$io_result' = 'No'`){
let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number); let $slave_param= Slave_IO_Running;
if (`SELECT '$sql_result' = 'No'`){ let $slave_param_value= No;
let $run= 0; source include/wait_for_slave_param.inc;
}
}
sleep 0.1;
if (!$counter){
--echo "Failed while waiting for slave to stop"
--replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
query_vertical SHOW SLAVE STATUS;
exit;
}
dec $counter;
}
let $slave_param= Slave_SQL_Running;
let $slave_param_value= No;
source include/wait_for_slave_param.inc;
let $slave_error_message= ;
# include/wait_show_pattern.inc
#
# SUMMARY
#
# Waits until output produced by SHOW statement which particular type is
# specified as parameter matches certain pattern or maximum time reached.
#
# NOTES
#
# Only the first row produced by the parameter statement is checked.
#
# USAGE
#
# let $show_type= <Tail of SHOW statement>;
# let $show_pattern= 'Pattern to be used for LIKE matching';
# --source wait_show_pattern.inc
#
# EXAMPLES
#
# alter_table-big.test, wait_slave_status.inc
#
# SEE ALSO
#
# wait_slave_status.inc, wait_condition.inc (>=5.1)
#
###############################################################################
--disable_query_log
# We accept to wait maximum 30 seconds (0.2 sec/loop).
let $wait_counter= 150;
while ($wait_counter)
{
let $result= `SHOW $show_type`;
let $success= `SELECT "$result" LIKE $show_pattern`;
if ($success)
{
let $wait_counter= 0;
}
if (!$success)
{
real_sleep 0.2;
dec $wait_counter;
}
}
if (!$success)
{
echo Timeout in wait_show_pattern.inc \$show_type= $show_type \$show_pattern= $show_pattern (\$result= '$result');
}
--enable_query_log
# include/wait_slave_status.inc
#
# Created by Matthias Leich
#
# SUMMARY
#
# Waits until slave has reached certain state or maximum time reached.
#
# (This script will not work, when the SHOW command delivers more than one
# result record, because only the first record will be caught.)
#
# USAGE
#
# Set $result_pattern in test file and source this file:
#
# let $result_pattern= <pattern used for LIKE on the result of
# SHOW STATUS SLAVE>
# --include wait_slave_status.inc
#
# EXAMPLE
#
# The script rpl_until.test:
# ...
# --replace_result $MASTER_MYPORT MASTER_MYPORT
# --replace_column 1 # 9 # 23 # 33 #
# --vertical_results show slave status;
#
# outputs
# show slave status;
# Slave_IO_State #
# Master_Host 127.0.0.1
# Master_User root
# Master_Port MASTER_MYPORT
# Connect_Retry 1
# Master_Log_File master-bin.000001
# Read_Master_Log_Pos 776
# Relay_Log_File slave-relay-bin.000004
# Relay_Log_Pos #
# Relay_Master_Log_File master-bin.000001
# Slave_IO_Running Yes
# Slave_SQL_Running No
# Replicate_Do_DB
# Replicate_Ignore_DB
# Replicate_Do_Table
# Replicate_Ignore_Table
# Replicate_Wild_Do_Table
# Replicate_Wild_Ignore_Table
# Last_Errno 0
# Last_Error
# Skip_Counter 0
# Exec_Master_Log_Pos 319
# Relay_Log_Space #
# Until_Condition Master
# Until_Log_File master-bin.000001
# Until_Log_Pos 319
# Master_SSL_Allowed No
# Master_SSL_CA_File
# Master_SSL_CA_Path
# Master_SSL_Cert
# Master_SSL_Cipher
# Master_SSL_Key
# Seconds_Behind_Master #
#
# The main problem with the "show slave status;" in rpl_until is, that
# depending on the total test engine power and the current load caused by
# other processes, the expected slave status might be not reached though
# it will happen in maybe some seconds.
#
# The typical problem with rpl_until is that Slave_IO_Running is "No"
# instead of "Yes".
#
# The expected result follows the LIKE pattern:
#
# let $result_pattern= '%127.0.0.1%root%1%master-bin.000001%776%slave-relay-bin.000004%master-bin.000001%Yes%No%0%0%319%Master%master-bin.000001%319%No%';
#
# The Slave_IO_Running value is the "Yes" just after the "master-bin.000001".
#
# How to get this pattern ?
#
# Any lines "--replace_result ..." and "--replace_colum ..." just before
# the SHOW TABLE STATUS and of course the expected result itself
# show us columns where the content must be unified, because it is non
# deterministic or it depends on the current test environment.
#
# Unfortunately "--replace_result ..." and "--replace_colum ..." do not
# affect the result of our assignment let $my_val= `SHOW SLAVE STATUS`;
# Therefore such content must be covered by '%'.
#
# Please be careful. A more simple pattern might be dangerous, because we
# might get "wrong" matches. Example: There might be several "Yes" and "No"
# within one result row.
#
###############################################################################
# We do not want to print the auxiliary commands, because they are not of
# interest and their amount will vary depending how fast we get the
# desired state.
--disable_query_log
# The protocol should show
# - the setting of $result_pattern and
# - that this file is sourced ,
# because this increases the chance to use the protocol as replay script.
eval SELECT "let \$result_pattern= $result_pattern ;" AS "";
SELECT '--source include/wait_slave_status.inc' AS "";
let $show_type= SLAVE STATUS;
let $show_pattern= $result_pattern;
--enable_query_log
--source include/wait_show_pattern.inc
if (!$success)
{
let $message= ! Attention: Timeout in wait_slave_status.inc.
| Possible reasons with decreasing probability:
| - The LIKE pattern is wrong, because the
| testcase was altered or the layout of the
| SHOW SLAVE STATUS result set changed.
| - There is a new bug within the replication.
| - We met an extreme testing environment and timeout is
| too small.;
--source include/show_msg80.inc
--echo DEBUG INFO START (wait_slave_status.inc):
--echo $result_pattern
--vertical_results
show slave status;
--echo DEBUG INFO END
}
...@@ -1078,6 +1078,7 @@ Note 1003 select timestampdiff(WEEK,'2001-02-01','2001-05-01') AS `a1`,timestamp ...@@ -1078,6 +1078,7 @@ Note 1003 select timestampdiff(WEEK,'2001-02-01','2001-05-01') AS `a1`,timestamp
select time_format('100:00:00', '%H %k %h %I %l'); select time_format('100:00:00', '%H %k %h %I %l');
time_format('100:00:00', '%H %k %h %I %l') time_format('100:00:00', '%H %k %h %I %l')
100 100 04 04 4 100 100 04 04 4
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (a timestamp default '2005-05-05 01:01:01', create table t1 (a timestamp default '2005-05-05 01:01:01',
b timestamp default '2005-05-05 01:01:01'); b timestamp default '2005-05-05 01:01:01');
...@@ -1121,6 +1122,7 @@ call t_sysdate(); ...@@ -1121,6 +1122,7 @@ call t_sysdate();
@a != @b @a != @b
1 1
drop procedure t_sysdate; drop procedure t_sysdate;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
select timestampdiff(month,'2004-09-11','2004-09-11'); select timestampdiff(month,'2004-09-11','2004-09-11');
timestampdiff(month,'2004-09-11','2004-09-11') timestampdiff(month,'2004-09-11','2004-09-11')
0 0
......
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
drop table if exists t1; drop table if exists t1;
drop database if exists mysqltest; drop database if exists mysqltest;
...@@ -1351,4 +1352,4 @@ DROP PROCEDURE sp3; ...@@ -1351,4 +1352,4 @@ DROP PROCEDURE sp3;
DROP USER 'userbug33464'@'localhost'; DROP USER 'userbug33464'@'localhost';
use test; use test;
DROP DATABASE dbbug33464; DROP DATABASE dbbug33464;
End of 5.1 tests SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
...@@ -365,6 +365,7 @@ insert into mysql.user select * from t1; ...@@ -365,6 +365,7 @@ insert into mysql.user select * from t1;
drop table t1, t2; drop table t1, t2;
drop database TESTDB; drop database TESTDB;
flush privileges; flush privileges;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
grant all privileges on test.* to `a@`@localhost; grant all privileges on test.* to `a@`@localhost;
grant execute on * to `a@`@localhost; grant execute on * to `a@`@localhost;
...@@ -380,7 +381,7 @@ drop function f2; ...@@ -380,7 +381,7 @@ drop function f2;
drop table t2; drop table t2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost; drop user `a@`@localhost;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database if exists mysqltest_1; drop database if exists mysqltest_1;
drop database if exists mysqltest_2; drop database if exists mysqltest_2;
drop user mysqltest_u1@localhost; drop user mysqltest_u1@localhost;
......
drop table if exists t1; drop table if exists t1;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (col1 integer primary key, col2 integer) engine=innodb; create table t1 (col1 integer primary key, col2 integer) engine=innodb;
insert t1 values (1,100); insert t1 values (1,100);
...@@ -19,4 +20,4 @@ rollback; ...@@ -19,4 +20,4 @@ rollback;
rollback; rollback;
drop table t1; drop table t1;
drop function f1; drop function f1;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
...@@ -3,6 +3,7 @@ drop table if exists t1; ...@@ -3,6 +3,7 @@ drop table if exists t1;
## Creating new user tt ## ## Creating new user tt ##
CREATE user tt@localhost; CREATE user tt@localhost;
## Setting value of variable to 0 ## ## Setting value of variable to 0 ##
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET @@global.log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators = 0;
## Creating new table t2 ## ## Creating new table t2 ##
create table t2 (a INT); create table t2 (a INT);
...@@ -69,3 +70,5 @@ drop function f1; ...@@ -69,3 +70,5 @@ drop function f1;
## Dropping table t1 & t2 ## ## Dropping table t1 & t2 ##
drop table t1,t2; drop table t1,t2;
## Disconnecting both the connections ## ## Disconnecting both the connections ##
DROP USER tt@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
...@@ -1116,12 +1116,13 @@ create procedure `p1`() ...@@ -1116,12 +1116,13 @@ create procedure `p1`()
begin begin
select a, f1() from t1; select a, f1() from t1;
end// end//
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
call p1()// call p1()//
a f1() a f1()
1 2 1 2
2 2 2 2
SET GLOBAL log_bin_trust_function_creators = 0; SET GLOBAL log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
drop procedure p1// drop procedure p1//
drop function f1// drop function f1//
drop table t1// drop table t1//
......
...@@ -314,6 +314,7 @@ drop procedure f2; ...@@ -314,6 +314,7 @@ drop procedure f2;
drop procedure f3; drop procedure f3;
drop procedure f4; drop procedure f4;
drop table t1; drop table t1;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
reset query cache; reset query cache;
drop function if exists f1; drop function if exists f1;
...@@ -346,7 +347,7 @@ id ...@@ -346,7 +347,7 @@ id
drop table t1; drop table t1;
drop function f1; drop function f1;
set GLOBAL query_cache_size=0; set GLOBAL query_cache_size=0;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
DROP DATABASE IF EXISTS bug30269; DROP DATABASE IF EXISTS bug30269;
FLUSH STATUS; FLUSH STATUS;
CREATE DATABASE bug30269; CREATE DATABASE bug30269;
......
...@@ -269,6 +269,7 @@ select * from t1; ...@@ -269,6 +269,7 @@ select * from t1;
convert_tz(NULL, NULL, NULL) convert_tz(NULL, NULL, NULL)
NULL NULL
drop table t1; drop table t1;
SET @old_log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (ldt datetime, udt datetime); create table t1 (ldt datetime, udt datetime);
create function f1(i datetime) returns datetime create function f1(i datetime) returns datetime
...@@ -284,7 +285,7 @@ ldt ldt2 ...@@ -284,7 +285,7 @@ ldt ldt2
2006-04-19 16:30:00 2006-04-19 16:30:00 2006-04-19 16:30:00 2006-04-19 16:30:00
drop table t1; drop table t1;
drop function f1; drop function f1;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (t TIMESTAMP); CREATE TABLE t1 (t TIMESTAMP);
INSERT INTO t1 VALUES (NULL), (NULL); INSERT INTO t1 VALUES (NULL), (NULL);
......
...@@ -51,6 +51,6 @@ enable_warnings; ...@@ -51,6 +51,6 @@ enable_warnings;
remove_file $MYSQLD_DATADIR/slave-relay-bin.000001; remove_file $MYSQLD_DATADIR/slave-relay-bin.000001;
remove_file $MYSQLD_DATADIR/slave-relay-bin.index; remove_file $MYSQLD_DATADIR/slave-relay-bin.index;
stop slave sql_thread; stop slave sql_thread;
let $keep_connection=1; let $slave_keep_connection=1;
source include/wait_for_slave_sql_to_stop.inc; source include/wait_for_slave_sql_to_stop.inc;
...@@ -21,7 +21,7 @@ a ...@@ -21,7 +21,7 @@ a
1 1
[on slave] [on slave]
==== Verify results on slave ==== ==== Verify results on slave ====
STOP SLAVE; include/stop_slave.inc
SELECT "" AS Slave_IO_State; SELECT "" AS Slave_IO_State;
Slave_IO_State Slave_IO_State
......
...@@ -92,7 +92,7 @@ Master D 4 D ...@@ -92,7 +92,7 @@ Master D 4 D
* Do failure for C and then make new connection B->D * * Do failure for C and then make new connection B->D *
STOP SLAVE; STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE; include/start_slave.inc
INSERT INTO t1 VALUES(6,'C',2); INSERT INTO t1 VALUES(6,'C',2);
INSERT INTO t1(b,c) VALUES('B',2); INSERT INTO t1(b,c) VALUES('B',2);
INSERT INTO t1(b,c) VALUES('A',2); INSERT INTO t1(b,c) VALUES('A',2);
...@@ -119,7 +119,7 @@ Master D 8 D ...@@ -119,7 +119,7 @@ Master D 8 D
STOP SLAVE; STOP SLAVE;
STOP SLAVE; STOP SLAVE;
CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS; CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_B_PORT,master_user='root',master_log_file='LOG_FILE',master_log_pos=LOG_POS;
START SLAVE; include/start_slave.inc
* Check data inserted before failure * * Check data inserted before failure *
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b; SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
...@@ -166,7 +166,7 @@ Master D 12 D ...@@ -166,7 +166,7 @@ Master D 12 D
*** Testing restoring scheme A->B->C->D->A after failure *** *** Testing restoring scheme A->B->C->D->A after failure ***
* Remove wrong event from C and restore B->C->D * * Remove wrong event from C and restore B->C->D *
STOP SLAVE; include/stop_slave.inc
DELETE FROM t1 WHERE a = 6; DELETE FROM t1 WHERE a = 6;
START SLAVE; START SLAVE;
RESET MASTER; RESET MASTER;
......
...@@ -18,11 +18,7 @@ start slave; ...@@ -18,11 +18,7 @@ start slave;
stop slave; stop slave;
change master to master_host='127.0.0.1',master_user='root', change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=SLAVE_PORT; master_password='',master_port=SLAVE_PORT;
start slave; include/start_slave.inc
let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
FLUSH LOGS; FLUSH LOGS;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
......
...@@ -103,10 +103,10 @@ DROP PROCEDURE just_log; ...@@ -103,10 +103,10 @@ DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log; DROP PROCEDURE calc_and_log;
DROP FUNCTION log_rows; DROP FUNCTION log_rows;
**** Resetting master and slave **** **** Resetting master and slave ****
STOP SLAVE; include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;
START SLAVE; include/start_slave.inc
#### 2. Using mixed mode #### #### 2. Using mixed mode ####
==== 2.1. Checking a procedure ==== ==== 2.1. Checking a procedure ====
**** On Master **** **** On Master ****
......
...@@ -5,8 +5,8 @@ reset slave; ...@@ -5,8 +5,8 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
set global max_connections=151; set global max_connections=151;
stop slave; include/stop_slave.inc
start slave; include/start_slave.inc
show variables like 'init_slave'; show variables like 'init_slave';
Variable_name Value Variable_name Value
init_slave set global max_connections=500 init_slave set global max_connections=500
...@@ -25,6 +25,6 @@ set global init_connect="set @c=1"; ...@@ -25,6 +25,6 @@ set global init_connect="set @c=1";
show variables like 'init_connect'; show variables like 'init_connect';
Variable_name Value Variable_name Value
init_connect set @c=1 init_connect set @c=1
stop slave; include/stop_slave.inc
set global init_connect= @my_global_init_connect; set global init_connect= @my_global_init_connect;
set global max_connections= default; set global max_connections= default;
...@@ -7,7 +7,7 @@ start slave; ...@@ -7,7 +7,7 @@ start slave;
show master status; show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB> master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
stop slave; include/stop_slave.inc
change master to master_log_pos=75; change master to master_log_pos=75;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
...@@ -49,7 +49,7 @@ Last_IO_Error # ...@@ -49,7 +49,7 @@ Last_IO_Error #
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
start slave; start slave;
stop slave; include/stop_slave.inc
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
......
...@@ -8,8 +8,8 @@ drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________ ...@@ -8,8 +8,8 @@ drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=1024; SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024; SET @@global.net_buffer_length=1024;
STOP SLAVE; include/stop_slave.inc
START SLAVE; include/start_slave.inc
select @@net_buffer_length, @@max_allowed_packet; select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet @@net_buffer_length @@max_allowed_packet
1024 1024 1024 1024
...@@ -27,8 +27,8 @@ SLAVE_RUNNING ON ...@@ -27,8 +27,8 @@ SLAVE_RUNNING ON
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________; drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
SET @@global.max_allowed_packet=4096; SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096; SET @@global.net_buffer_length=4096;
STOP SLAVE; include/stop_slave.inc
START SLAVE; include/start_slave.inc
CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM; CREATE TABLe `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048'); INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
show slave status; show slave status;
......
...@@ -423,10 +423,10 @@ a b c ...@@ -423,10 +423,10 @@ a b c
**** On Master **** **** On Master ****
DELETE FROM t1; DELETE FROM t1;
**** Resetting master and slave **** **** Resetting master and slave ****
STOP SLAVE; include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;
START SLAVE; include/start_slave.inc
**** On Master **** **** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master **** **** On Master ****
......
...@@ -423,10 +423,10 @@ a b c ...@@ -423,10 +423,10 @@ a b c
**** On Master **** **** On Master ****
DELETE FROM t1; DELETE FROM t1;
**** Resetting master and slave **** **** Resetting master and slave ****
STOP SLAVE; include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;
START SLAVE; include/start_slave.inc
**** On Master **** **** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master **** **** On Master ****
......
...@@ -16,6 +16,6 @@ INSERT INTO t1 VALUES (1); ...@@ -16,6 +16,6 @@ INSERT INTO t1 VALUES (1);
[on slave] [on slave]
Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables Last_SQL_Error = Error 'Table 'test.t1' doesn't exist' on opening tables
==== Clean up ==== ==== Clean up ====
STOP SLAVE; include/stop_slave.inc
[on master] [on master]
DROP TABLE t1; DROP TABLE t1;
...@@ -4,7 +4,7 @@ reset master; ...@@ -4,7 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
stop slave; include/stop_slave.inc
reset master; reset master;
reset slave; reset slave;
reset master; reset master;
...@@ -113,11 +113,7 @@ Aberdeen ...@@ -113,11 +113,7 @@ Aberdeen
Abernathy Abernathy
aberrant aberrant
aberration aberration
start slave; include/start_slave.inc
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
select * from t1 order by 1 asc; select * from t1 order by 1 asc;
word word
Aarhus Aarhus
...@@ -190,7 +186,8 @@ Abernathy ...@@ -190,7 +186,8 @@ Abernathy
aberrant aberrant
aberration aberration
flush logs; flush logs;
stop slave; include/stop_slave.inc
include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM; create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1); insert into t2 values (1);
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
...@@ -220,7 +217,6 @@ show binary logs; ...@@ -220,7 +217,6 @@ show binary logs;
Log_name File_size Log_name File_size
master-bin.000001 1540 master-bin.000001 1540
master-bin.000002 516 master-bin.000002 516
start slave;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
slave-bin.000001 1638 slave-bin.000001 1638
......
...@@ -4,7 +4,7 @@ reset master; ...@@ -4,7 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
stop slave; include/stop_slave.inc
reset master; reset master;
reset slave; reset slave;
reset master; reset master;
...@@ -113,11 +113,7 @@ Aberdeen ...@@ -113,11 +113,7 @@ Aberdeen
Abernathy Abernathy
aberrant aberrant
aberration aberration
start slave; include/start_slave.inc
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
select * from t1 order by 1 asc; select * from t1 order by 1 asc;
word word
Aarhus Aarhus
...@@ -190,7 +186,8 @@ Abernathy ...@@ -190,7 +186,8 @@ Abernathy
aberrant aberrant
aberration aberration
flush logs; flush logs;
stop slave; include/stop_slave.inc
include/start_slave.inc
create table t2 (n int)ENGINE=InnoDB; create table t2 (n int)ENGINE=InnoDB;
insert into t2 values (1); insert into t2 values (1);
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
...@@ -220,7 +217,6 @@ show binary logs; ...@@ -220,7 +217,6 @@ show binary logs;
Log_name File_size Log_name File_size
master-bin.000001 1456 master-bin.000001 1456
master-bin.000002 474 master-bin.000002 474
start slave;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
slave-bin.000001 1536 slave-bin.000001 1536
......
...@@ -13,4 +13,5 @@ select count(*) from t1; ...@@ -13,4 +13,5 @@ select count(*) from t1;
count(*) count(*)
70 70
drop table t1; drop table t1;
include/stop_slave.inc
drop table t1; drop table t1;
...@@ -4,7 +4,7 @@ reset master; ...@@ -4,7 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
stop slave; include/stop_slave.inc
create table t1(n int not null auto_increment primary key); create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4); insert into t1 values (1),(2),(3),(4);
drop table t1; drop table t1;
...@@ -149,7 +149,7 @@ Last_IO_Error # ...@@ -149,7 +149,7 @@ Last_IO_Error #
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
start slave; start slave;
stop slave; include/stop_slave.inc
start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740; start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
......
...@@ -44,9 +44,9 @@ a b ...@@ -44,9 +44,9 @@ a b
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a b a b
1 AA_for_row_or_YY_for_stmt_mixed 1 AA_for_row_or_YY_for_stmt_mixed
STOP SLAVE; include/stop_slave.inc
RENAME TABLE t3_bak TO t3; RENAME TABLE t3_bak TO t3;
START SLAVE; include/start_slave.inc
TRUNCATE t1; TRUNCATE t1;
TRUNCATE t2; TRUNCATE t2;
TRUNCATE t3; TRUNCATE t3;
...@@ -78,9 +78,9 @@ SELECT * FROM t1 ORDER BY a; ...@@ -78,9 +78,9 @@ SELECT * FROM t1 ORDER BY a;
a b a b
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a b a b
STOP SLAVE; include/stop_slave.inc
RENAME TABLE t3_bak TO t3; RENAME TABLE t3_bak TO t3;
START SLAVE; include/start_slave.inc
TRUNCATE t1; TRUNCATE t1;
TRUNCATE t2; TRUNCATE t2;
TRUNCATE t3; TRUNCATE t3;
...@@ -116,8 +116,8 @@ SELECT * FROM t1 ORDER BY a; ...@@ -116,8 +116,8 @@ SELECT * FROM t1 ORDER BY a;
a b a b
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
a b a b
STOP SLAVE; include/stop_slave.inc
RENAME TABLE t3_bak TO t3; RENAME TABLE t3_bak TO t3;
START SLAVE; include/start_slave.inc
*** Clean up *** *** Clean up ***
DROP TABLE t1,t2,t3; DROP TABLE t1,t2,t3;
...@@ -166,7 +166,7 @@ BEGIN ...@@ -166,7 +166,7 @@ BEGIN
UPDATE t3 SET a =2, b = 'master only'; UPDATE t3 SET a =2, b = 'master only';
END| END|
**** On Slave **** **** On Slave ****
STOP SLAVE; include/stop_slave.inc
**** On Master **** **** On Master ****
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1; UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
DROP TRIGGER tr1; DROP TRIGGER tr1;
...@@ -188,7 +188,7 @@ a b ...@@ -188,7 +188,7 @@ a b
3 master/slave 3 master/slave
*** On Slave *** *** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; include/start_slave.inc
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
a b a b
1 master/slave 1 master/slave
...@@ -208,7 +208,7 @@ CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb; ...@@ -208,7 +208,7 @@ CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb; CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb; CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
**** On Slave **** **** On Slave ****
STOP SLAVE; include/stop_slave.inc
*** On Master *** *** On Master ***
BEGIN; BEGIN;
INSERT INTO t4 VALUES (2, 'master only'); INSERT INTO t4 VALUES (2, 'master only');
...@@ -234,7 +234,7 @@ a b ...@@ -234,7 +234,7 @@ a b
3 master/slave 3 master/slave
*** On Slave *** *** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; include/start_slave.inc
SELECT * FROM t4 ORDER BY a; SELECT * FROM t4 ORDER BY a;
a b a b
3 master/slave 3 master/slave
...@@ -245,7 +245,7 @@ SELECT * FROM t6 ORDER BY a; ...@@ -245,7 +245,7 @@ SELECT * FROM t6 ORDER BY a;
a b a b
3 master/slave 3 master/slave
**** On Slave **** **** On Slave ****
STOP SLAVE; include/stop_slave.inc
*** On Master *** *** On Master ***
BEGIN; BEGIN;
INSERT INTO t4 VALUES (6, 'master only'); INSERT INTO t4 VALUES (6, 'master only');
...@@ -277,7 +277,7 @@ a b ...@@ -277,7 +277,7 @@ a b
7 master only 7 master only
*** On Slave *** *** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
START SLAVE; include/start_slave.inc
SELECT * FROM t4 ORDER BY a; SELECT * FROM t4 ORDER BY a;
a b a b
3 master/slave 3 master/slave
...@@ -287,7 +287,7 @@ a b ...@@ -287,7 +287,7 @@ a b
SELECT * FROM t6 ORDER BY a; SELECT * FROM t6 ORDER BY a;
a b a b
3 master/slave 3 master/slave
STOP SLAVE; include/stop_slave.inc
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
INSERT INTO t4 VALUES (4, 'master only'); INSERT INTO t4 VALUES (4, 'master only');
INSERT INTO t5 VALUES (4, 'master only'); INSERT INTO t5 VALUES (4, 'master only');
...@@ -323,7 +323,7 @@ a b ...@@ -323,7 +323,7 @@ a b
7 master only 7 master only
*** On Slave *** *** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; include/start_slave.inc
SELECT * FROM t4 ORDER BY a; SELECT * FROM t4 ORDER BY a;
a b a b
3 master/slave 3 master/slave
...@@ -341,7 +341,7 @@ DROP TABLE t4, t5, t6; ...@@ -341,7 +341,7 @@ DROP TABLE t4, t5, t6;
*** On Master *** *** On Master ***
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam; CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
*** On Slave *** *** On Slave ***
STOP SLAVE; include/stop_slave.inc
*** On Master *** *** On Master ***
SET SESSION BINLOG_FORMAT=STATEMENT; SET SESSION BINLOG_FORMAT=STATEMENT;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|'; LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
...@@ -352,7 +352,7 @@ a b ...@@ -352,7 +352,7 @@ a b
3 master only 3 master only
*** On Slave *** *** On Slave ***
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; include/start_slave.inc
SELECT * FROM t10 ORDER BY a; SELECT * FROM t10 ORDER BY a;
a b a b
DROP TABLE t10; DROP TABLE t10;
...@@ -8,9 +8,9 @@ start slave; ...@@ -8,9 +8,9 @@ start slave;
[on master] [on master]
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl'; GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
[on slave] [on slave]
STOP SLAVE; include/stop_slave.inc
CHANGE MASTER TO master_user='rpl', master_password='rpl'; CHANGE MASTER TO master_user='rpl', master_password='rpl';
START SLAVE; include/start_slave.inc
==== Do replication as new user ==== ==== Do replication as new user ====
[on master] [on master]
CREATE TABLE t1 (n INT); CREATE TABLE t1 (n INT);
...@@ -25,7 +25,7 @@ DROP USER rpl@127.0.0.1; ...@@ -25,7 +25,7 @@ DROP USER rpl@127.0.0.1;
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
[on slave] [on slave]
==== Restart slave without privileges ===== ==== Restart slave without privileges =====
STOP SLAVE; include/stop_slave.inc
START SLAVE; START SLAVE;
==== Verify that Slave_IO_Running = No ==== ==== Verify that Slave_IO_Running = No ====
Slave_IO_Running = No (should be No) Slave_IO_Running = No (should be No)
......
...@@ -191,11 +191,15 @@ begin ...@@ -191,11 +191,15 @@ begin
return unix_timestamp(); return unix_timestamp();
end| end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_routine_creators=1; set global log_bin_trust_routine_creators=1;
Warnings: Warnings:
Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set global log_bin_trust_function_creators=0; set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1; set global log_bin_trust_function_creators=1;
set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1; set global log_bin_trust_function_creators=1;
create function fn2() create function fn2()
returns int returns int
...@@ -549,8 +553,14 @@ insert into t values (1); ...@@ -549,8 +553,14 @@ insert into t values (1);
return 0; return 0;
end end
master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`() master-bin.000001 # Query 1 # use `mysqltest`; SELECT `mysqltest2`.`f1`()
set global log_bin_trust_function_creators=0; set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
set global log_bin_trust_function_creators=0; Warnings:
Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
Warnings:
Warning 1287 The syntax 'log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 5.2. Please use 'log_bin_trust_function_creators' instead
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database mysqltest; drop database mysqltest;
drop database mysqltest2; drop database mysqltest2;
use test; use test;
......
...@@ -4,6 +4,7 @@ reset master; ...@@ -4,6 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1; drop procedure if exists p1;
drop procedure if exists p2; drop procedure if exists p2;
drop function if exists f1; drop function if exists f1;
...@@ -275,5 +276,5 @@ E ...@@ -275,5 +276,5 @@ E
drop table t2; drop table t2;
drop procedure sp_bug26199; drop procedure sp_bug26199;
drop function sf_bug26199; drop function sf_bug26199;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
end of the tests end of the tests
...@@ -4,7 +4,7 @@ reset master; ...@@ -4,7 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
stop slave; include/stop_slave.inc
reset master; reset master;
reset slave; reset slave;
reset master; reset master;
...@@ -109,11 +109,7 @@ Aberdeen ...@@ -109,11 +109,7 @@ Aberdeen
Abernathy Abernathy
aberrant aberrant
aberration aberration
start slave; include/start_slave.inc
let $result_pattern= '%127.0.0.1%root%master-bin.000002%slave-relay-bin.000005%Yes%Yes%0%0%None%' ;
--source include/wait_slave_status.inc
select * from t1 order by 1 asc; select * from t1 order by 1 asc;
word word
Aarhus Aarhus
...@@ -186,7 +182,8 @@ Abernathy ...@@ -186,7 +182,8 @@ Abernathy
aberrant aberrant
aberration aberration
flush logs; flush logs;
stop slave; include/stop_slave.inc
include/start_slave.inc
create table t2 (n int)ENGINE=MyISAM; create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1); insert into t2 values (1);
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
...@@ -209,7 +206,6 @@ show binary logs; ...@@ -209,7 +206,6 @@ show binary logs;
Log_name File_size Log_name File_size
master-bin.000001 1347 master-bin.000001 1347
master-bin.000002 392 master-bin.000002 392
start slave;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
slave-bin.000001 1450 slave-bin.000001 1450
......
...@@ -4,7 +4,7 @@ reset master; ...@@ -4,7 +4,7 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
stop slave; include/stop_slave.inc
create table t1(n int not null auto_increment primary key); create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4); insert into t1 values (1),(2),(3),(4);
drop table t1; drop table t1;
...@@ -149,7 +149,7 @@ Last_IO_Error # ...@@ -149,7 +149,7 @@ Last_IO_Error #
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
start slave; start slave;
stop slave; include/stop_slave.inc
start slave until master_log_file='master-bin.000001', master_log_pos=776; start slave until master_log_file='master-bin.000001', master_log_pos=776;
SHOW SLAVE STATUS; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
......
...@@ -40,10 +40,10 @@ SET @user_num = 10; ...@@ -40,10 +40,10 @@ SET @user_num = 10;
SET @user_text = 'Alunda'; SET @user_text = 'Alunda';
[on master] [on master]
**** Resetting master and slave **** **** Resetting master and slave ****
STOP SLAVE; include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;
START SLAVE; include/start_slave.inc
[on slave] [on slave]
SET @@global.init_slave = 'ant'; SET @@global.init_slave = 'ant';
[on master] [on master]
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
# #
# To simulate the slave correctly, we wait until everything up to but # To simulate the slave correctly, we wait until everything up to but
# not including the XID is replicated. This has to be done with # not including the XID is replicated. This has to be done with
# include/wait_for_slave_io_to_sync.inc, not sync_slave_with_master, # include/sync_slave_io_with_master.inc, not sync_slave_with_master,
# since the latter waits until the slave *SQL* thread has caught up # since the latter waits until the slave *SQL* thread has caught up
# with the master's position, which it will never do. # with the master's position, which it will never do.
# #
...@@ -70,8 +70,7 @@ sync_with_master 0; ...@@ -70,8 +70,7 @@ sync_with_master 0;
--echo ==== Verify results on slave ==== --echo ==== Verify results on slave ====
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
let $tmp= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1); let $tmp= query_get_value("SHOW SLAVE STATUS", Slave_IO_State, 1);
eval SELECT "$tmp" AS Slave_IO_State; eval SELECT "$tmp" AS Slave_IO_State;
let $tmp= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); let $tmp= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
......
...@@ -57,8 +57,7 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b; ...@@ -57,8 +57,7 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2); connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
STOP SLAVE; STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
START SLAVE; source include/start_slave.inc;
--source include/wait_for_slave_to_start.inc
disconnect slave; disconnect slave;
--connection master_c --connection master_c
INSERT INTO t1 VALUES(6,'C',2); INSERT INTO t1 VALUES(6,'C',2);
...@@ -67,9 +66,7 @@ INSERT INTO t1 VALUES(6,'C',2); ...@@ -67,9 +66,7 @@ INSERT INTO t1 VALUES(6,'C',2);
INSERT INTO t1(b,c) VALUES('B',2); INSERT INTO t1(b,c) VALUES('B',2);
# Wait while C will stop. # Wait while C will stop.
--connection master_c --connection master_c
--let $slave_param= Slave_SQL_Running source include/wait_for_slave_sql_to_stop.inc;
--let $slave_param_value= No
--source include/wait_for_slave_param.inc
--connection master_a --connection master_a
INSERT INTO t1(b,c) VALUES('A',2); INSERT INTO t1(b,c) VALUES('A',2);
--connection master_d --connection master_d
...@@ -105,8 +102,7 @@ STOP SLAVE; ...@@ -105,8 +102,7 @@ STOP SLAVE;
--replace_result $SLAVE_MYPORT MASTER_B_PORT $file_c LOG_FILE $pos_c LOG_POS --replace_result $SLAVE_MYPORT MASTER_B_PORT $file_c LOG_FILE $pos_c LOG_POS
--eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c --eval CHANGE MASTER TO master_host='127.0.0.1',master_port=$SLAVE_MYPORT,master_user='root',master_log_file='$file_c',master_log_pos=$pos_c
connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2); connect(slave,127.0.0.1,root,,test,$SLAVE_MYPORT2);
START SLAVE; source include/start_slave.inc;
--source include/wait_for_slave_to_start.inc
disconnect slave; disconnect slave;
--connection master_b --connection master_b
--sync_slave_with_master master_d --sync_slave_with_master master_d
...@@ -154,8 +150,7 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b; ...@@ -154,8 +150,7 @@ SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
# distributed to other servers # distributed to other servers
--echo * Remove wrong event from C and restore B->C->D * --echo * Remove wrong event from C and restore B->C->D *
--connection master_d --connection master_d
STOP SLAVE; source include/stop_slave.inc;
--wait_for_slave_to_stop
--connection master_c --connection master_c
DELETE FROM t1 WHERE a = 6; DELETE FROM t1 WHERE a = 6;
START SLAVE; START SLAVE;
......
...@@ -12,7 +12,7 @@ source include/have_innodb.inc; ...@@ -12,7 +12,7 @@ source include/have_innodb.inc;
# set up "dual head" # set up "dual head"
let $keep_connection= 1; let $slave_keep_connection= 1;
connection slave; connection slave;
reset master; reset master;
......
...@@ -25,13 +25,8 @@ stop slave; ...@@ -25,13 +25,8 @@ stop slave;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_host='127.0.0.1',master_user='root', eval change master to master_host='127.0.0.1',master_user='root',
master_password='',master_port=$SLAVE_MYPORT; master_password='',master_port=$SLAVE_MYPORT;
start slave;
# source include/start_slave.inc;
# Wait for start of slave IO and SQL threads
#
let $result_pattern= '%127.0.0.1%root%slave-bin.000001%slave-bin.000001%Yes%Yes%0%0%None%';
--source include/wait_slave_status.inc
# #
# Flush logs of slave # Flush logs of slave
......
...@@ -207,9 +207,8 @@ select * from ti1 order by b /* must be (2),(3) */; ...@@ -207,9 +207,8 @@ select * from ti1 order by b /* must be (2),(3) */;
# foreign key: row is referenced # foreign key: row is referenced
--echo *** slave must stop --echo *** slave must stop
source include/wait_for_slave_sql_to_stop.inc;
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
...@@ -240,11 +239,10 @@ delete from ti1 where b=3; ...@@ -240,11 +239,10 @@ delete from ti1 where b=3;
connection master; connection master;
insert into ti2 set a=3, b=3 /* offending write event */; insert into ti2 set a=3, b=3 /* offending write event */;
--echo *** slave must stop
source include/wait_for_slave_sql_to_stop.inc;
--echo *** slave must stop
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
...@@ -282,9 +280,8 @@ connection master; ...@@ -282,9 +280,8 @@ connection master;
insert into ti1 set b=1 /* offending write event */; insert into ti1 set b=1 /* offending write event */;
--echo *** slave must stop --echo *** slave must stop
source include/wait_for_slave_sql_to_stop.inc;
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
...@@ -318,9 +315,8 @@ connection master; ...@@ -318,9 +315,8 @@ connection master;
DELETE FROM t1 WHERE a = -2; DELETE FROM t1 WHERE a = -2;
--echo *** slave must stop --echo *** slave must stop
source include/wait_for_slave_sql_to_stop.inc;
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
...@@ -337,9 +333,8 @@ set global slave_exec_mode='STRICT'; ...@@ -337,9 +333,8 @@ set global slave_exec_mode='STRICT';
connection master; connection master;
DELETE FROM t2 WHERE a = -2; DELETE FROM t2 WHERE a = -2;
--echo *** slave must stop --echo *** slave must stop
source include/wait_for_slave_sql_to_stop.inc;
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
...@@ -360,9 +355,8 @@ connection master; ...@@ -360,9 +355,8 @@ connection master;
UPDATE t1 SET a = 1 WHERE a = -1; UPDATE t1 SET a = 1 WHERE a = -1;
--echo *** slave must stop --echo *** slave must stop
source include/wait_for_slave_sql_to_stop.inc;
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
...@@ -381,9 +375,8 @@ connection master; ...@@ -381,9 +375,8 @@ connection master;
UPDATE t2 SET a = 1 WHERE a = -1; UPDATE t2 SET a = 1 WHERE a = -1;
--echo *** slave must stop --echo *** slave must stop
source include/wait_for_slave_sql_to_stop.inc;
connection slave; connection slave;
source include/wait_for_slave_sql_to_stop.inc;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1);
disable_query_log; disable_query_log;
......
...@@ -14,7 +14,7 @@ REPLACE INTO t1 VALUES (4); ...@@ -14,7 +14,7 @@ REPLACE INTO t1 VALUES (4);
SELECT * FROM t1; SELECT * FROM t1;
connection slave; connection slave;
--wait_for_slave_to_stop source include/wait_for_slave_sql_to_stop.inc;
# The 4 should not be inserted into the table, since the incident log # The 4 should not be inserted into the table, since the incident log
# event should have stop the slave. # event should have stop the slave.
......
...@@ -7,33 +7,25 @@ source include/master-slave.inc; ...@@ -7,33 +7,25 @@ source include/master-slave.inc;
set global max_connections=151; set global max_connections=151;
connection slave; connection slave;
stop slave; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc; source include/start_slave.inc;
start slave;
source include/wait_for_slave_to_start.inc;
connection master; connection master;
save_master_pos; sync_slave_with_master;
connection slave;
show variables like 'init_slave'; show variables like 'init_slave';
show variables like 'max_connections'; show variables like 'max_connections';
sync_with_master;
reset master; reset master;
connection master; connection master;
show variables like 'init_slave'; show variables like 'init_slave';
show variables like 'max_connections'; show variables like 'max_connections';
save_master_pos; sync_slave_with_master;
connection slave;
sync_with_master;
# Save variable value # Save variable value
set @my_global_init_connect= @@global.init_connect; set @my_global_init_connect= @@global.init_connect;
set global init_connect="set @c=1"; set global init_connect="set @c=1";
show variables like 'init_connect'; show variables like 'init_connect';
connection master; connection master;
save_master_pos; sync_slave_with_master;
connection slave; source include/stop_slave.inc;
sync_with_master;
stop slave;
# Restore changed global variable # Restore changed global variable
set global init_connect= @my_global_init_connect; set global init_connect= @my_global_init_connect;
......
...@@ -13,20 +13,14 @@ ...@@ -13,20 +13,14 @@
source include/master-slave.inc; source include/master-slave.inc;
source include/show_master_status.inc; source include/show_master_status.inc;
sync_slave_with_master; sync_slave_with_master;
stop slave; source include/stop_slave.inc;
--source include/wait_for_slave_to_stop.inc
change master to master_log_pos=75; change master to master_log_pos=75;
source include/show_slave_status2.inc; source include/show_slave_status2.inc;
start slave; start slave;
let $slave_param= Slave_SQL_Running; source include/wait_for_slave_sql_to_start.inc;
let $slave_param_value= Yes; source include/wait_for_slave_io_to_stop.inc;
--source include/wait_for_slave_param.inc source include/stop_slave.inc;
let $slave_param= Slave_IO_Running;
let $slave_param_value= No;
--source include/wait_for_slave_param.inc
stop slave;
--source include/wait_for_slave_to_stop.inc
source include/show_slave_status.inc; source include/show_slave_status.inc;
connection master; connection master;
......
...@@ -18,10 +18,8 @@ SET @@global.net_buffer_length=1024; ...@@ -18,10 +18,8 @@ SET @@global.net_buffer_length=1024;
# Restart slave for setting to take effect # Restart slave for setting to take effect
connection slave; connection slave;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc; source include/start_slave.inc;
START SLAVE;
source include/wait_for_slave_to_start.inc;
# Reconnect to master for new setting to take effect # Reconnect to master for new setting to take effect
disconnect master; disconnect master;
...@@ -65,10 +63,8 @@ SET @@global.net_buffer_length=4096; ...@@ -65,10 +63,8 @@ SET @@global.net_buffer_length=4096;
# Restart slave for new setting to take effect # Restart slave for new setting to take effect
connection slave; connection slave;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc; source include/start_slave.inc;
START SLAVE;
source include/wait_for_slave_to_start.inc;
# Reconnect to master for new setting to take effect # Reconnect to master for new setting to take effect
disconnect master; disconnect master;
......
...@@ -35,8 +35,7 @@ let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1); ...@@ -35,8 +35,7 @@ let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
--echo Last_SQL_Error = $err --echo Last_SQL_Error = $err
--echo ==== Clean up ==== --echo ==== Clean up ====
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
--echo [on master] --echo [on master]
connection master; connection master;
......
...@@ -15,12 +15,12 @@ save_master_pos; ...@@ -15,12 +15,12 @@ save_master_pos;
connection slave; connection slave;
# slave will automatically tell itself to stop thanks to the .opt # slave will automatically stop the sql thread thanks to the .opt
# file; it will initiate the stop request after the first # file; it will initiate the stop request after the first
# Rows_log_event (out of 3) but should wait until the last one is # Rows_log_event (out of 3) but should wait until the last one is
# executed before stopping. # executed before stopping.
wait_for_slave_to_stop; source include/wait_for_slave_sql_to_stop.inc;
# check that we inserted all rows (waited until the last Rows event) # check that we inserted all rows (waited until the last Rows event)
select count(*) from t1; select count(*) from t1;
...@@ -28,4 +28,5 @@ select count(*) from t1; ...@@ -28,4 +28,5 @@ select count(*) from t1;
connection master; connection master;
drop table t1; drop table t1;
connection slave; # slave SQL thread is stopped connection slave; # slave SQL thread is stopped
source include/stop_slave.inc;
drop table t1; drop table t1;
...@@ -9,12 +9,8 @@ let $VERSION=`select version()`; ...@@ -9,12 +9,8 @@ let $VERSION=`select version()`;
# stop slave before he will start replication also sync with master # stop slave before he will start replication also sync with master
# for avoiding undetermenistic behaviour # for avoiding undetermenistic behaviour
save_master_pos; sync_slave_with_master;
connection slave; --source include/stop_slave.inc
sync_with_master;
stop slave;
# Make sure the slave sql and io thread has stopped
--source include/wait_for_slave_to_stop.inc
connection master; connection master;
# create some events on master # create some events on master
...@@ -53,9 +49,7 @@ connection master; ...@@ -53,9 +49,7 @@ connection master;
save_master_pos; save_master_pos;
connection slave; connection slave;
sync_with_master; sync_with_master;
stop slave; --source include/stop_slave.inc
# Make sure the slave sql and io thread has stopped
--source include/wait_for_slave_to_stop.inc
# this should stop immediately as we are already there # this should stop immediately as we are already there
start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740; start slave sql_thread until master_log_file='master-bin.000001', master_log_pos=740;
......
...@@ -9,8 +9,7 @@ connection slave; ...@@ -9,8 +9,7 @@ connection slave;
reset master; reset master;
# replicate ourselves # replicate ourselves
stop slave; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT --replace_result $SLAVE_MYPORT SLAVE_PORT
eval change master to master_port=$SLAVE_MYPORT; eval change master to master_port=$SLAVE_MYPORT;
start slave; start slave;
......
...@@ -77,11 +77,9 @@ if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) { ...@@ -77,11 +77,9 @@ if (!`SELECT @@BINLOG_FORMAT = 'ROW'`) {
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
} }
STOP SLAVE; --source include/stop_slave.inc
--source include/wait_for_slave_to_stop.inc
RENAME TABLE t3_bak TO t3; RENAME TABLE t3_bak TO t3;
START SLAVE; --source include/start_slave.inc
--source include/wait_for_slave_to_start.inc
--connection master --connection master
TRUNCATE t1; TRUNCATE t1;
...@@ -121,11 +119,9 @@ SHOW TABLES LIKE 't%'; ...@@ -121,11 +119,9 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
STOP SLAVE; --source include/stop_slave.inc
--source include/wait_for_slave_to_stop.inc
RENAME TABLE t3_bak TO t3; RENAME TABLE t3_bak TO t3;
START SLAVE; --source include/start_slave.inc
--source include/wait_for_slave_to_start.inc
--connection master --connection master
TRUNCATE t1; TRUNCATE t1;
...@@ -167,11 +163,9 @@ SHOW TABLES LIKE 't%'; ...@@ -167,11 +163,9 @@ SHOW TABLES LIKE 't%';
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
STOP SLAVE; source include/stop_slave.inc;
--source include/wait_for_slave_to_stop.inc
RENAME TABLE t3_bak TO t3; RENAME TABLE t3_bak TO t3;
START SLAVE; source include/start_slave.inc;
--source include/wait_for_slave_to_start.inc
# Clean up # Clean up
--echo *** Clean up *** --echo *** Clean up ***
......
...@@ -110,8 +110,7 @@ DELIMITER ;| ...@@ -110,8 +110,7 @@ DELIMITER ;|
--echo **** On Slave **** --echo **** On Slave ****
sync_slave_with_master; sync_slave_with_master;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
...@@ -131,8 +130,7 @@ save_master_pos; ...@@ -131,8 +130,7 @@ save_master_pos;
--echo *** On Slave *** --echo *** On Slave ***
connection slave; connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
sync_with_master; sync_with_master;
SELECT * FROM t1 ORDER BY a; SELECT * FROM t1 ORDER BY a;
...@@ -156,8 +154,7 @@ CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb; ...@@ -156,8 +154,7 @@ CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
--echo **** On Slave **** --echo **** On Slave ****
sync_slave_with_master; sync_slave_with_master;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
--echo *** On Master *** --echo *** On Master ***
connection master; connection master;
...@@ -182,8 +179,7 @@ save_master_pos; ...@@ -182,8 +179,7 @@ save_master_pos;
--echo *** On Slave *** --echo *** On Slave ***
connection slave; connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
sync_with_master; sync_with_master;
SELECT * FROM t4 ORDER BY a; SELECT * FROM t4 ORDER BY a;
...@@ -194,8 +190,7 @@ SELECT * FROM t6 ORDER BY a; ...@@ -194,8 +190,7 @@ SELECT * FROM t6 ORDER BY a;
--echo **** On Slave **** --echo **** On Slave ****
connection slave; connection slave;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
--echo *** On Master *** --echo *** On Master ***
connection master; connection master;
...@@ -220,8 +215,7 @@ save_master_pos; ...@@ -220,8 +215,7 @@ save_master_pos;
--echo *** On Slave *** --echo *** On Slave ***
connection slave; connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
sync_with_master; sync_with_master;
SELECT * FROM t4 ORDER BY a; SELECT * FROM t4 ORDER BY a;
...@@ -232,8 +226,7 @@ SELECT * FROM t6 ORDER BY a; ...@@ -232,8 +226,7 @@ SELECT * FROM t6 ORDER BY a;
# And the same, but with autocommit = 0 # And the same, but with autocommit = 0
# #
connection slave; connection slave;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
connection master; connection master;
SET AUTOCOMMIT=0; SET AUTOCOMMIT=0;
...@@ -257,8 +250,7 @@ save_master_pos; ...@@ -257,8 +250,7 @@ save_master_pos;
--echo *** On Slave *** --echo *** On Slave ***
connection slave; connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
sync_with_master; sync_with_master;
SELECT * FROM t4 ORDER BY a; SELECT * FROM t4 ORDER BY a;
...@@ -280,8 +272,7 @@ CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam; ...@@ -280,8 +272,7 @@ CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
--echo *** On Slave *** --echo *** On Slave ***
sync_slave_with_master; sync_slave_with_master;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
--echo *** On Master *** --echo *** On Master ***
connection master; connection master;
...@@ -297,8 +288,7 @@ save_master_pos; ...@@ -297,8 +288,7 @@ save_master_pos;
--echo *** On Slave *** --echo *** On Slave ***
connection slave; connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
sync_with_master; sync_with_master;
SELECT * FROM t10 ORDER BY a; SELECT * FROM t10 ORDER BY a;
......
...@@ -27,11 +27,9 @@ GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl'; ...@@ -27,11 +27,9 @@ GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
--echo [on slave] --echo [on slave]
sync_slave_with_master; sync_slave_with_master;
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
CHANGE MASTER TO master_user='rpl', master_password='rpl'; CHANGE MASTER TO master_user='rpl', master_password='rpl';
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
--echo ==== Do replication as new user ==== --echo ==== Do replication as new user ====
--echo [on master] --echo [on master]
...@@ -53,8 +51,7 @@ sync_slave_with_master; ...@@ -53,8 +51,7 @@ sync_slave_with_master;
--echo ==== Restart slave without privileges ===== --echo ==== Restart slave without privileges =====
# (slave.err will contain access denied error for this START SLAVE command) # (slave.err will contain access denied error for this START SLAVE command)
STOP SLAVE; source include/stop_slave.inc;
source include/wait_for_slave_to_stop.inc;
START SLAVE; START SLAVE;
source include/wait_for_slave_sql_to_start.inc; source include/wait_for_slave_sql_to_start.inc;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
source include/have_binlog_format_mixed.inc; source include/have_binlog_format_mixed.inc;
source include/master-slave.inc; source include/master-slave.inc;
# we need a db != test, where we don't have automatic grants # we need a db != test, where we don't have automatic grants
--disable_warnings --disable_warnings
drop database if exists mysqltest1; drop database if exists mysqltest1;
...@@ -240,6 +241,8 @@ begin ...@@ -240,6 +241,8 @@ begin
end| end|
delimiter ;| delimiter ;|
connection master; connection master;
set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
# test old variable name: # test old variable name:
set global log_bin_trust_routine_creators=1; set global log_bin_trust_routine_creators=1;
# now use new name: # now use new name:
...@@ -247,6 +250,8 @@ set global log_bin_trust_function_creators=0; ...@@ -247,6 +250,8 @@ set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1; set global log_bin_trust_function_creators=1;
# slave needs it too otherwise will not execute what master allowed: # slave needs it too otherwise will not execute what master allowed:
connection slave; connection slave;
set @old_log_bin_trust_routine_creators= @@global.log_bin_trust_routine_creators;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1; set global log_bin_trust_function_creators=1;
connection con1; connection con1;
...@@ -571,9 +576,12 @@ show binlog events in 'master-bin.000001' from 106; ...@@ -571,9 +576,12 @@ show binlog events in 'master-bin.000001' from 106;
# Restore log_bin_trust_function_creators to its original value. # Restore log_bin_trust_function_creators to its original value.
# This is a cleanup for all parts above where we tested stored # This is a cleanup for all parts above where we tested stored
# functions and triggers. # functions and triggers.
set global log_bin_trust_function_creators=0; connection slave;
set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
connection master; connection master;
set global log_bin_trust_function_creators=0; set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators;
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# Clean up # Clean up
drop database mysqltest; drop database mysqltest;
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
# **************************************************************** # ****************************************************************
connection master; connection master;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
# cleanup # cleanup
--disable_warnings --disable_warnings
drop procedure if exists p1; drop procedure if exists p1;
...@@ -254,8 +256,8 @@ drop table t2; ...@@ -254,8 +256,8 @@ drop table t2;
drop procedure sp_bug26199; drop procedure sp_bug26199;
drop function sf_bug26199; drop function sf_bug26199;
sync_slave_with_master; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 0; sync_slave_with_master;
--echo end of the tests --echo end of the tests
...@@ -8,12 +8,8 @@ let $VERSION=`select version()`; ...@@ -8,12 +8,8 @@ let $VERSION=`select version()`;
# stop slave before he will start replication also sync with master # stop slave before he will start replication also sync with master
# for avoiding undetermenistic behaviour # for avoiding undetermenistic behaviour
save_master_pos; sync_slave_with_master;
connection slave; --source include/stop_slave.inc
sync_with_master;
stop slave;
# Make sure the slave sql and io thread has stopped
--source include/wait_for_slave_to_stop.inc
connection master; connection master;
# create some events on master # create some events on master
...@@ -49,12 +45,8 @@ source include/show_slave_status2.inc; ...@@ -49,12 +45,8 @@ source include/show_slave_status2.inc;
# clean up # clean up
start slave; start slave;
connection master; connection master;
save_master_pos; sync_slave_with_master;
connection slave; --source include/stop_slave.inc
sync_with_master;
stop slave;
# Make sure the slave sql and io thread has stopped
--source include/wait_for_slave_to_stop.inc
# this should stop immediately as we are already there # this should stop immediately as we are already there
start slave until master_log_file='master-bin.000001', master_log_pos=776; start slave until master_log_file='master-bin.000001', master_log_pos=776;
......
...@@ -180,7 +180,7 @@ Last_IO_Error <Last_IO_Error> ...@@ -180,7 +180,7 @@ Last_IO_Error <Last_IO_Error>
Last_SQL_Errno <Last_SQL_Errno> Last_SQL_Errno <Last_SQL_Errno>
Last_SQL_Error <Last_SQL_Error> Last_SQL_Error <Last_SQL_Error>
set GLOBAL slave_transaction_retries=10; set GLOBAL slave_transaction_retries=10;
START SLAVE; include/start_slave.inc
select * from t1 order by nid; select * from t1 order by nid;
nid nom prenom nid nom prenom
1 LOCK ABC1 1 LOCK ABC1
......
...@@ -423,10 +423,10 @@ a b c ...@@ -423,10 +423,10 @@ a b c
**** On Master **** **** On Master ****
DELETE FROM t1; DELETE FROM t1;
**** Resetting master and slave **** **** Resetting master and slave ****
STOP SLAVE; include/stop_slave.inc
RESET SLAVE; RESET SLAVE;
RESET MASTER; RESET MASTER;
START SLAVE; include/start_slave.inc
**** On Master **** **** On Master ****
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M'); INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
**** On Master **** **** On Master ****
......
...@@ -184,22 +184,21 @@ set GLOBAL slave_transaction_retries=1; ...@@ -184,22 +184,21 @@ set GLOBAL slave_transaction_retries=1;
--echo **** On Master **** --echo **** On Master ****
UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1; UPDATE t1 SET `nom`="DEAD" WHERE `nid`=1;
--echo **** On Slave ****
# Wait for deadlock to be detected. # Wait for deadlock to be detected.
# When detected, the slave will stop, so we just wait for it to stop. # When detected, the slave will stop, so we just wait for it to stop.
connection slave;
source include/wait_for_slave_sql_to_stop.inc; source include/wait_for_slave_sql_to_stop.inc;
# Replication should have stopped, since max retries were not enough. # Replication should have stopped, since max retries were not enough.
# verify with show slave status # verify with show slave status
--connection slave
--echo **** On Slave ****
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error> --replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error>
--query_vertical SHOW SLAVE STATUS; --query_vertical SHOW SLAVE STATUS;
# now set max retries high enough to succeed, and start slave again # now set max retries high enough to succeed, and start slave again
set GLOBAL slave_transaction_retries=10; set GLOBAL slave_transaction_retries=10;
START SLAVE; source include/start_slave.inc;
source include/wait_for_slave_to_start.inc;
# Wait for deadlock to be detected and retried. # Wait for deadlock to be detected and retried.
# We want to wait until at least one retry has been made, but before # We want to wait until at least one retry has been made, but before
# the slave stops. currently, there is no safe way to do that: we # the slave stops. currently, there is no safe way to do that: we
......
...@@ -106,3 +106,4 @@ rpl_max_binlog_size_func : BUG#37962 2008-07-08 sven *_func tests c ...@@ -106,3 +106,4 @@ rpl_max_binlog_size_func : BUG#37962 2008-07-08 sven *_func tests c
slow_query_log_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions slow_query_log_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
sql_low_priority_updates_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions sql_low_priority_updates_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
timestamp_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions timestamp_func : BUG#37962 2008-07-08 sven *_func tests containing sleeps/race conditions
log_output_func : BUG#37766 2008-07-10 sven main.log_output_func randomly fails in pushbuild
...@@ -606,6 +606,7 @@ select time_format('100:00:00', '%H %k %h %I %l'); ...@@ -606,6 +606,7 @@ select time_format('100:00:00', '%H %k %h %I %l');
# Bug #12562: Make SYSDATE behave like it does in Oracle: always the current # Bug #12562: Make SYSDATE behave like it does in Oracle: always the current
# time, regardless of magic to make NOW() always the same for the # time, regardless of magic to make NOW() always the same for the
# entirety of a statement. # entirety of a statement.
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (a timestamp default '2005-05-05 01:01:01', create table t1 (a timestamp default '2005-05-05 01:01:01',
...@@ -656,6 +657,7 @@ end; ...@@ -656,6 +657,7 @@ end;
delimiter ;// delimiter ;//
call t_sysdate(); call t_sysdate();
drop procedure t_sysdate; drop procedure t_sysdate;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# #
# Bug #13534: timestampdiff() returned incorrect results across leap years # Bug #13534: timestampdiff() returned incorrect results across leap years
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Grant tests not performed with embedded server # Grant tests not performed with embedded server
-- source include/not_embedded.inc -- source include/not_embedded.inc
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
# Cleanup # Cleanup
...@@ -1468,4 +1469,4 @@ use test; ...@@ -1468,4 +1469,4 @@ use test;
DROP DATABASE dbbug33464; DROP DATABASE dbbug33464;
--echo End of 5.1 tests SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
...@@ -488,6 +488,7 @@ flush privileges; ...@@ -488,6 +488,7 @@ flush privileges;
# BUG#13310 incorrect user parsing by SP # BUG#13310 incorrect user parsing by SP
# #
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
grant all privileges on test.* to `a@`@localhost; grant all privileges on test.* to `a@`@localhost;
...@@ -512,7 +513,7 @@ connection default; ...@@ -512,7 +513,7 @@ connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost; REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
drop user `a@`@localhost; drop user `a@`@localhost;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# #
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
drop table if exists t1; drop table if exists t1;
--enable_warnings --enable_warnings
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
...@@ -39,4 +41,4 @@ drop table t1; ...@@ -39,4 +41,4 @@ drop table t1;
drop function f1; drop function f1;
disconnect a; disconnect a;
disconnect b; disconnect b;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
...@@ -35,6 +35,7 @@ drop table if exists t1; ...@@ -35,6 +35,7 @@ drop table if exists t1;
CREATE user tt@localhost; CREATE user tt@localhost;
--echo ## Setting value of variable to 0 ## --echo ## Setting value of variable to 0 ##
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET @@global.log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators = 0;
--echo ## Creating new table t2 ## --echo ## Creating new table t2 ##
...@@ -119,3 +120,7 @@ drop table t1,t2; ...@@ -119,3 +120,7 @@ drop table t1,t2;
--echo ## Disconnecting both the connections ## --echo ## Disconnecting both the connections ##
disconnect test_con2; disconnect test_con2;
connection default;
DROP USER tt@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
...@@ -801,9 +801,10 @@ create procedure `p1`() ...@@ -801,9 +801,10 @@ create procedure `p1`()
begin begin
select a, f1() from t1; select a, f1() from t1;
end// end//
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
call p1()// call p1()//
SET GLOBAL log_bin_trust_function_creators = 0; SET GLOBAL log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
drop procedure p1// drop procedure p1//
drop function f1// drop function f1//
......
...@@ -183,6 +183,8 @@ drop table t1; ...@@ -183,6 +183,8 @@ drop table t1;
# #
# bug#14767: INSERT in SF + concurrent SELECT with query cache # bug#14767: INSERT in SF + concurrent SELECT with query cache
# #
connection default;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
reset query cache; reset query cache;
...@@ -224,7 +226,7 @@ disconnect con2; ...@@ -224,7 +226,7 @@ disconnect con2;
connection default; connection default;
set GLOBAL query_cache_size=0; set GLOBAL query_cache_size=0;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
# #
# Bug #30269 Query cache eats memory # Bug #30269 Query cache eats memory
......
...@@ -73,8 +73,7 @@ sync_with_master; ...@@ -73,8 +73,7 @@ sync_with_master;
SET @@global.init_slave = "SET @a=5"; SET @@global.init_slave = "SET @a=5";
stop slave; source include/stop_slave.inc;
--wait_for_slave_to_stop
reset slave; reset slave;
# Clean up old test tables # Clean up old test tables
--disable_warnings --disable_warnings
......
...@@ -228,6 +228,7 @@ drop table t1; ...@@ -228,6 +228,7 @@ drop table t1;
# Test for bug #11081 "Using a CONVERT_TZ function in a stored function # Test for bug #11081 "Using a CONVERT_TZ function in a stored function
# or trigger fails". # or trigger fails".
# #
SET @old_log_bin_trust_function_creators = @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1; SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (ldt datetime, udt datetime); create table t1 (ldt datetime, udt datetime);
...@@ -243,7 +244,7 @@ select ldt, f1(udt) as ldt2 from t1; ...@@ -243,7 +244,7 @@ select ldt, f1(udt) as ldt2 from t1;
drop table t1; drop table t1;
drop function f1; drop function f1;
SET GLOBAL log_bin_trust_function_creators = 0; SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
# End of 5.0 tests # End of 5.0 tests
......
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