Commit 6270e3be authored by Serge Kozlov's avatar Serge Kozlov

Bug#48308

Merge mysql-trunk-bugfixing -> mysql-next-mr-bugfixing
parents 2d4687d0 7e888463
...@@ -12,5 +12,9 @@ ...@@ -12,5 +12,9 @@
remove_file $_fake_relay_log; remove_file $_fake_relay_log;
remove_file $_fake_relay_index; remove_file $_fake_relay_index;
--disable_query_log --disable_query_log
--disable_warnings
STOP SLAVE SQL_THREAD;
RESET SLAVE;
eval SET @@global.relay_log_purge= $_fake_relay_log_purge; eval SET @@global.relay_log_purge= $_fake_relay_log_purge;
--enable_warnings
--enable_query_log --enable_query_log
...@@ -66,8 +66,16 @@ let $_fake_relay_index= $MYSQLD_DATADIR/$_fake_filename.index; ...@@ -66,8 +66,16 @@ let $_fake_relay_index= $MYSQLD_DATADIR/$_fake_filename.index;
# CHANGE MASTER modifies it (see the manual for CHANGE MASTER). # CHANGE MASTER modifies it (see the manual for CHANGE MASTER).
let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`; let $_fake_relay_log_purge= `SELECT @@global.relay_log_purge`;
# Reset slave and remove relay log and index files if they exist
RESET SLAVE;
error 0,1;
remove_file $MYSQLD_DATADIR/$_fake_filename.000001;
error 0,1;
remove_file $MYSQLD_DATADIR/$_fake_filename.index;
# Create relay log file. # Create relay log file.
copy_file $fake_relay_log $_fake_relay_log; copy_file $fake_relay_log $_fake_relay_log;
# Create relay log index. # Create relay log index.
# After patch for BUG#12190, the filename used in CHANGE MASTER # After patch for BUG#12190, the filename used in CHANGE MASTER
...@@ -77,28 +85,12 @@ copy_file $fake_relay_log $_fake_relay_log; ...@@ -77,28 +85,12 @@ copy_file $fake_relay_log $_fake_relay_log;
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`) if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
{ {
-- let $_index_entry= ./$_fake_filename-fake.000001 eval select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
} }
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`) if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
{ {
-- let $_index_entry= .\\\\$_fake_filename-fake.000001 eval select '.\\\\$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index';
}
if (`SELECT LENGTH(@@secure_file_priv) > 0`)
{
-- let $_file_priv_dir= `SELECT @@secure_file_priv`;
-- let $_suffix= `SELECT UUID()`
-- let $_tmp_file= $_file_priv_dir/fake-index.$_suffix
-- eval select '$_index_entry\n' into dumpfile '$_tmp_file'
-- copy_file $_tmp_file $_fake_relay_index
-- remove_file $_tmp_file
}
if (`SELECT LENGTH(@@secure_file_priv) = 0`)
{
-- eval select '$_index_entry\n' into dumpfile '$_fake_relay_index'
} }
# Setup replication from existing relay log. # Setup replication from existing relay log.
......
SET @old_relay_log_purge= @@global.relay_log_purge; Setting up fake replication from MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
change master to
MASTER_HOST='dummy.localdomain',
RELAY_LOG_FILE='slave-relay-bin.000001',
RELAY_LOG_POS=4;
start slave sql_thread; start slave sql_thread;
select MASTER_POS_WAIT('master-bin.000001', 3776); select MASTER_POS_WAIT('master-bin.000001', 3776);
# Result on slave # Result on slave
...@@ -38,5 +34,4 @@ DROP PROCEDURE IF EXISTS p2; ...@@ -38,5 +34,4 @@ DROP PROCEDURE IF EXISTS p2;
DROP FUNCTION IF EXISTS f1; DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1; DROP TRIGGER IF EXISTS tr1;
stop slave sql_thread; stop slave sql_thread;
reset slave; Cleaning up after setup_fake_relay_log.inc
SET @@global.relay_log_purge= @old_relay_log_purge;
...@@ -17,35 +17,8 @@ ...@@ -17,35 +17,8 @@
source include/have_log_bin.inc; source include/have_log_bin.inc;
# Need to restore this at the end; CHANGE MASTER modifies it (see the let $fake_relay_log= $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001;
# manual for CHANGE MASTER). source include/setup_fake_relay_log.inc;
SET @old_relay_log_purge= @@global.relay_log_purge;
let $MYSQLD_DATADIR= `select @@datadir`;
copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLD_DATADIR/slave-relay-bin.000001;
# After patch for BUG#12190, the filename used in CHANGE MASTER
# RELAY_LOG_FILE will be automatically added the directory of the
# relay log before comparison, thus we need to added the directory
# part (./ on unix .\ on windows) when faking the relay-log-bin.index.
disable_query_log;
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
{
eval select './slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index';
}
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") != 0`)
{
eval select '.\\\\slave-relay-bin.000001\n' into dumpfile '$MYSQLD_DATADIR/slave-relay-bin.index';
}
enable_query_log;
change master to
MASTER_HOST='dummy.localdomain',
RELAY_LOG_FILE='slave-relay-bin.000001',
RELAY_LOG_POS=4;
start slave sql_thread; start slave sql_thread;
disable_result_log; disable_result_log;
...@@ -66,9 +39,4 @@ DROP TRIGGER IF EXISTS tr1; ...@@ -66,9 +39,4 @@ DROP TRIGGER IF EXISTS tr1;
enable_warnings; enable_warnings;
stop slave sql_thread; stop slave sql_thread;
reset slave; source include/cleanup_fake_relay_log.inc;
source include/wait_for_slave_sql_to_stop.inc;
remove_file $MYSQLD_DATADIR/slave-relay-bin.000001;
remove_file $MYSQLD_DATADIR/slave-relay-bin.index;
SET @@global.relay_log_purge= @old_relay_log_purge;
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