mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
78c8bfdddf
Problem 1: tests often fail in pushbuild with a timeout when waiting for the slave to start/stop/receive error. Fix 1: Updated the wait_for_slave_* macros in the following way: - The timeout is increased by a factor ten - Refactored the macros so that wait_for_slave_param does the work for the other macros. Problem 2: Tests are often incorrectly written, lacking a source include/wait_for_slave_to_[start|stop].inc. Fix 2: Improved the chance to get it right by adding include/start_slave.inc and include/stop_slave.inc, and updated tests to use these. Problem 3: The the built-in test language command wait_for_slave_to_stop is a misnomer (does not wait for the slave io thread) and does not give as much debug info in case of failure as the otherwise equivalent macro source include/wait_for_slave_sql_to_stop.inc Fix 3: Replaced all calls to the built-in command by a call to the macro. Problem 4: Some, but not all, of the wait_for_slave_* macros had an implicit connection slave. This made some tests confusing to read, and made it more difficult to use the macro in circular replication scenarios, where the connection named master needs to wait. Fix 4: Removed the implicit connection slave from all wait_for_slave_* macros, and updated tests to use an explicit connection slave where necessary. Problem 5: The macros wait_slave_status.inc and wait_show_pattern.inc were unused. Moreover, using them is difficult and error-prone. Fix 5: remove these macros. Problem 6: log_bin_trust_function_creators_basic failed when running tests because it assumed @@global.log_bin_trust_function_creators=1, and some tests modified this variable without resetting it to its original value. Fix 6: All tests that use this variable have been updated so that they reset the value at end of test.
95 lines
3.8 KiB
Text
95 lines
3.8 KiB
Text
###################### mysql-test\t\init_slave_func.test #####################
|
|
# #
|
|
# Variable Name: init_slave #
|
|
# Scope: GLOBAL #
|
|
# Access Type: Dynamic #
|
|
# Data Type: string #
|
|
# Default Value: #
|
|
# Range: #
|
|
# #
|
|
# #
|
|
# Creation Date: 2008-03-08 #
|
|
# Author: Rizwan #
|
|
# #
|
|
# Description: Test Cases of Dynamic System Variable init_slave #
|
|
# that checks the behavior of this variable #
|
|
# #
|
|
# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
|
|
# server-system-variables.html #
|
|
# #
|
|
###############################################################################
|
|
|
|
source include/master-slave.inc;
|
|
|
|
--echo '#--------------------FN_DYNVARS_037_01-------------------------#'
|
|
##################################################################
|
|
# Check if setting init_slave is changed in every new connection #
|
|
##################################################################
|
|
|
|
SET @@global.init_slave = "SET @a = 10";
|
|
|
|
--echo 'connect (con1,localhost,root,,)'
|
|
connect (con1,localhost,root,,);
|
|
--echo 'connection con1'
|
|
connection con1;
|
|
SELECT @@global.init_slave;
|
|
disconnect con1;
|
|
--echo 'connection master'
|
|
connection master;
|
|
|
|
--echo '#--------------------FN_DYNVARS_037_02-------------------------#'
|
|
####################################################
|
|
# Begin the functionality Testing of init_slave #
|
|
####################################################
|
|
|
|
#====================================================
|
|
--echo 'check if value in slave opt file is executed'
|
|
#====================================================
|
|
save_master_pos;
|
|
--echo 'connection slave'
|
|
connection slave;
|
|
sleep 1;
|
|
show variables like 'init_slave';
|
|
show variables like 'max_connections';
|
|
sync_with_master;
|
|
reset master;
|
|
|
|
#===============================================================
|
|
--echo 'check if value in slave opt file doesnt apply to master'
|
|
#===============================================================
|
|
|
|
--echo 'connection master'
|
|
connection master;
|
|
show variables like 'init_slave';
|
|
show variables like 'max_connections';
|
|
save_master_pos;
|
|
--echo 'connection slave'
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
#=======================================================
|
|
--echo 'try creating a temporary variable in init_slave'
|
|
#=======================================================
|
|
|
|
SET @@global.init_slave = "SET @a=5";
|
|
|
|
source include/stop_slave.inc;
|
|
reset slave;
|
|
# Clean up old test tables
|
|
--disable_warnings
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
--enable_warnings
|
|
start slave;
|
|
|
|
SHOW VARIABLES LIKE 'init_slave';
|
|
SELECT @a;
|
|
|
|
--echo 'Bug#35365 SET statement in init_slave not execute if slave is restarted'
|
|
|
|
# Restore value
|
|
set global max_connections= default;
|
|
|
|
##################################################
|
|
# End of functionality Testing for init_slave #
|
|
##################################################
|
|
|