#At file:///media/sdb2/hezx/work/mysql/bzr/b54649/next-mr-rpl-merge/ based on revid:zhenxing.he@stripped
3000 He Zhenxing 2010-06-24
BUG#54649 Remove unused code in file repl_failsafe.cc
Removed repl_failsafe.*, moved SHOW SLAVE HOSTS related code
to rpl_master.cc, removed options --init-rpl-role,
--rpl-recover-rank and status variable Rpl_status.
removed:
mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc
mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test
mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test
sql/repl_failsafe.cc
sql/repl_failsafe.h
modified:
libmysqld/CMakeLists.txt
mysql-test/lib/v1/mysql-test-run.pl
mysql-test/r/mysqld--help-notwin.result
mysql-test/r/mysqld--help-win.result
mysql-test/r/variables.result
mysql-test/suite/perfschema/r/dml_setup_instruments.result
mysql-test/suite/perfschema/r/server_init.result
mysql-test/suite/perfschema/t/server_init.test
mysql-test/suite/rpl/rpl_1slave_base.cnf
mysql-test/suite/rpl/t/rpl_ip_mix.cnf
mysql-test/suite/rpl/t/rpl_ip_mix2.cnf
mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf
mysql-test/suite/rpl/t/rpl_ipv6.cnf
mysql-test/suite/rpl_ndb/my.cnf
mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf
mysql-test/t/variables.test
sql/CMakeLists.txt
sql/Makefile.am
sql/mysqld.cc
sql/mysqld.h
sql/rpl_master.cc
sql/rpl_master.h
sql/rpl_slave.cc
sql/sql_parse.cc
sql/sql_show.cc
sql/sys_vars.cc
=== modified file 'libmysqld/CMakeLists.txt'
--- a/libmysqld/CMakeLists.txt 2010-06-22 06:03:00 +0000
+++ b/libmysqld/CMakeLists.txt 2010-06-24 04:52:52 +0000
@@ -54,7 +54,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc l
../sql/log_event.cc ../sql/mf_iocache.cc ../sql/my_decimal.cc
../sql/net_serv.cc ../sql/opt_range.cc ../sql/opt_sum.cc
../sql/parse_file.cc ../sql/procedure.cc ../sql/protocol.cc
- ../sql/records.cc ../sql/repl_failsafe.cc ../sql/rpl_filter.cc
+ ../sql/records.cc ../sql/rpl_filter.cc
../sql/rpl_record.cc ../sql/sha2.cc ../sql/des_key_file.cc
../sql/rpl_injector.cc ../sql/set_var.cc ../sql/spatial.cc
../sql/sp_cache.cc ../sql/sp.cc ../sql/sp_head.cc
=== modified file 'mysql-test/lib/v1/mysql-test-run.pl'
--- a/mysql-test/lib/v1/mysql-test-run.pl 2010-03-22 10:36:23 +0000
+++ b/mysql-test/lib/v1/mysql-test-run.pl 2010-06-24 04:52:52 +0000
@@ -3959,7 +3959,6 @@ sub mysqld_arguments ($$$$) {
mtr_error("unknown mysqld type")
unless $mysqld->{'type'} eq 'slave';
- mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix);
if (! ( $opt_skip_slave_binlog || $skip_binlog ))
{
mtr_add_arg($args, "%s--log-bin=%s/log/slave%s-bin", $prefix,
@@ -4016,9 +4015,7 @@ sub mysqld_arguments ($$$$) {
# $master->[0]->{'port'}); # First master
# }
my $slave_server_id= 2 + $idx;
- my $slave_rpl_rank= $slave_server_id;
mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id);
- mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank);
}
my $cluster= $clusters->[$mysqld->{'cluster'}];
@@ -4094,12 +4091,7 @@ sub mysqld_arguments ($$$$) {
mtr_add_arg($args, "%s%s", $prefix, "--core-file");
}
- if ( $opt_bench )
- {
- mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix);
- mtr_add_arg($args, "%s--init-rpl-role=master", $prefix);
- }
- elsif ( $mysqld->{'type'} eq 'master' )
+ if ( !$opt_bench and $mysqld->{'type'} eq 'master' )
{
mtr_add_arg($args, "%s--open-files-limit=1024", $prefix);
}
=== modified file 'mysql-test/r/mysqld--help-notwin.result'
--- a/mysql-test/r/mysqld--help-notwin.result 2010-05-28 05:48:10 +0000
+++ b/mysql-test/r/mysqld--help-notwin.result 2010-06-24 04:52:52 +0000
@@ -171,8 +171,6 @@ The following options may be given as th
Disable initialization of builtin InnoDB plugin
--init-connect=name Command(s) that are executed for each new connection
--init-file=name Read SQL commands from this file at startup
- --init-rpl-role=name
- Set the replication role.
--init-slave=name Command(s) that are executed by a slave server each time
the SQL thread starts
--interactive-timeout=#
@@ -575,8 +573,6 @@ The following options may be given as th
not sure, leave this option unset
--report-user=name The account user name of the slave to be reported to the
master during slave registration
- --rpl-recovery-rank=#
- Unused, will be removed
--safe-mode Skip some optimize stages (for testing).
--safe-user-create Don't allow new user creation by the user who has no
write privileges to the mysql.user table.
@@ -770,7 +766,6 @@ help TRUE
ignore-builtin-innodb FALSE
init-connect
init-file (No default value)
-init-rpl-role MASTER
init-slave
interactive-timeout 28800
join-buffer-size 131072
@@ -891,7 +886,6 @@ report-host (No default value)
report-password (No default value)
report-port 3306
report-user (No default value)
-rpl-recovery-rank 0
safe-user-create FALSE
secure-auth FALSE
secure-file-priv (No default value)
=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result 2010-05-28 05:48:10 +0000
+++ b/mysql-test/r/mysqld--help-win.result 2010-06-24 04:52:52 +0000
@@ -171,8 +171,6 @@ The following options may be given as th
Disable initialization of builtin InnoDB plugin
--init-connect=name Command(s) that are executed for each new connection
--init-file=name Read SQL commands from this file at startup
- --init-rpl-role=name
- Set the replication role.
--init-slave=name Command(s) that are executed by a slave server each time
the SQL thread starts
--interactive-timeout=#
@@ -575,8 +573,6 @@ The following options may be given as th
not sure, leave this option unset
--report-user=name The account user name of the slave to be reported to the
master during slave registration
- --rpl-recovery-rank=#
- Unused, will be removed
--safe-mode Skip some optimize stages (for testing).
--safe-user-create Don't allow new user creation by the user who has no
write privileges to the mysql.user table.
@@ -774,7 +770,6 @@ help TRUE
ignore-builtin-innodb FALSE
init-connect
init-file (No default value)
-init-rpl-role MASTER
init-slave
interactive-timeout 28800
join-buffer-size 131072
@@ -895,7 +890,6 @@ report-host (No default value)
report-password (No default value)
report-port 3306
report-user (No default value)
-rpl-recovery-rank 0
safe-user-create FALSE
secure-auth FALSE
secure-file-priv (No default value)
=== modified file 'mysql-test/r/variables.result'
--- a/mysql-test/r/variables.result 2010-06-17 07:22:36 +0000
+++ b/mysql-test/r/variables.result 2010-06-24 04:52:52 +0000
@@ -21,7 +21,6 @@ set @my_net_write_timeout =@@glo
set @my_net_read_timeout =@@global.net_read_timeout;
set @my_query_cache_limit =@@global.query_cache_limit;
set @my_query_cache_type =@@global.query_cache_type;
-set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
set @my_storage_engine =@@global.default_storage_engine;
@@ -542,9 +541,6 @@ set read_buffer_size=100;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '100'
set read_rnd_buffer_size=100;
-set global rpl_recovery_rank=100;
-Warnings:
-Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
set global server_id=100;
set global slow_launch_time=100;
set sort_buffer_size=100;
@@ -1063,9 +1059,6 @@ set global net_write_timeout =@m
set global net_read_timeout =@my_net_read_timeout;
set global query_cache_limit =@my_query_cache_limit;
set global query_cache_type =@my_query_cache_type;
-set global rpl_recovery_rank =@my_rpl_recovery_rank;
-Warnings:
-Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global default_storage_engine =@my_storage_engine;
=== modified file 'mysql-test/suite/perfschema/r/dml_setup_instruments.result'
--- a/mysql-test/suite/perfschema/r/dml_setup_instruments.result 2010-05-25 09:34:36 +0000
+++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result 2010-06-24 04:52:52 +0000
@@ -41,11 +41,11 @@ wait/synch/cond/sql/COND_global_read_loc
wait/synch/cond/sql/COND_manager YES YES
wait/synch/cond/sql/COND_queue_state YES YES
wait/synch/cond/sql/COND_refresh YES YES
-wait/synch/cond/sql/COND_rpl_status YES YES
wait/synch/cond/sql/COND_server_started YES YES
wait/synch/cond/sql/COND_thread_cache YES YES
wait/synch/cond/sql/COND_thread_count YES YES
wait/synch/cond/sql/Delayed_insert::cond YES YES
+wait/synch/cond/sql/Delayed_insert::cond_client YES YES
select * from performance_schema.SETUP_INSTRUMENTS
where name='Wait';
select * from performance_schema.SETUP_INSTRUMENTS
=== modified file 'mysql-test/suite/perfschema/r/server_init.result'
--- a/mysql-test/suite/perfschema/r/server_init.result 2010-01-12 01:47:27 +0000
+++ b/mysql-test/suite/perfschema/r/server_init.result 2010-06-24 04:52:52 +0000
@@ -124,10 +124,6 @@ where name like "wait/synch/mutex/sql/LO
count(name)
1
select count(name) from MUTEX_INSTANCES
-where name like "wait/synch/mutex/sql/LOCK_rpl_status";
-count(name)
-1
-select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOG_INFO::lock";
count(name)
1
@@ -216,10 +212,6 @@ where name like "wait/synch/cond/sql/CON
count(name)
1
select count(name) from COND_INSTANCES
-where name like "wait/synch/cond/sql/COND_rpl_status";
-count(name)
-1
-select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
count(name)
1
=== modified file 'mysql-test/suite/perfschema/t/server_init.test'
--- a/mysql-test/suite/perfschema/t/server_init.test 2010-06-03 13:30:54 +0000
+++ b/mysql-test/suite/perfschema/t/server_init.test 2010-06-24 04:52:52 +0000
@@ -137,9 +137,6 @@ select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOCK_server_started";
select count(name) from MUTEX_INSTANCES
- where name like "wait/synch/mutex/sql/LOCK_rpl_status";
-
-select count(name) from MUTEX_INSTANCES
where name like "wait/synch/mutex/sql/LOG_INFO::lock";
select count(name) from MUTEX_INSTANCES
@@ -234,9 +231,6 @@ select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/COND_flush_thread_cache";
select count(name) from COND_INSTANCES
- where name like "wait/synch/cond/sql/COND_rpl_status";
-
-select count(name) from COND_INSTANCES
where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed";
select count(name) from COND_INSTANCES
=== modified file 'mysql-test/suite/rpl/rpl_1slave_base.cnf'
--- a/mysql-test/suite/rpl/rpl_1slave_base.cnf 2009-10-21 12:59:47 +0000
+++ b/mysql-test/suite/rpl/rpl_1slave_base.cnf 2010-06-24 04:52:52 +0000
@@ -22,7 +22,6 @@ loose-innodb
log-bin= slave-bin
relay-log= slave-relay-bin
-init-rpl-role= slave
log-slave-updates
master-retry-count= 10
=== modified file 'mysql-test/suite/rpl/t/rpl_ip_mix.cnf'
--- a/mysql-test/suite/rpl/t/rpl_ip_mix.cnf 2009-11-23 16:38:42 +0000
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix.cnf 2010-06-24 04:52:52 +0000
@@ -26,7 +26,6 @@ bind-address= ::
log-bin= slave-bin
relay-log= slave-relay-bin
-init-rpl-role= slave
log-slave-updates
master-retry-count= 10
=== modified file 'mysql-test/suite/rpl/t/rpl_ip_mix2.cnf'
--- a/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf 2009-11-23 16:38:42 +0000
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.cnf 2010-06-24 04:52:52 +0000
@@ -26,7 +26,6 @@ bind-address= 0.0.0.0
log-bin= slave-bin
relay-log= slave-relay-bin
-init-rpl-role= slave
log-slave-updates
master-retry-count= 10
=== modified file 'mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf'
--- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf 2009-11-23 16:38:42 +0000
+++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.cnf 2010-06-24 04:52:52 +0000
@@ -26,7 +26,6 @@ bind-address= 0.0.0.0
log-bin= slave-bin
relay-log= slave-relay-bin
-init-rpl-role= slave
log-slave-updates
master-retry-count= 10
=== modified file 'mysql-test/suite/rpl/t/rpl_ipv6.cnf'
--- a/mysql-test/suite/rpl/t/rpl_ipv6.cnf 2009-11-23 16:38:42 +0000
+++ b/mysql-test/suite/rpl/t/rpl_ipv6.cnf 2010-06-24 04:52:52 +0000
@@ -26,7 +26,6 @@ bind-address= ::
log-bin= slave-bin
relay-log= slave-relay-bin
-init-rpl-role= slave
log-slave-updates
master-retry-count= 10
=== modified file 'mysql-test/suite/rpl_ndb/my.cnf'
--- a/mysql-test/suite/rpl_ndb/my.cnf 2010-06-19 07:50:33 +0000
+++ b/mysql-test/suite/rpl_ndb/my.cnf 2010-06-24 04:52:52 +0000
@@ -37,7 +37,6 @@ relay-log= slave-rela
# Cluster only supports row format
binlog-format= row
-init-rpl-role= slave
log-slave-updates
master-retry-count= 10
@@ -55,9 +54,6 @@ skip-slave-start
# test results will vary, thus a relative path is used.
slave-load-tmpdir= ../../../tmp
-rpl-recovery-rank= @mysqld.1.slave.server-id
-
-
[ENV]
NDB_CONNECTSTRING= @mysql_cluster.1.ndb_connectstring
MASTER_MYPORT= @mysqld.1.1.port
=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf 2009-11-04 12:28:20 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_2ch.cnf 2010-06-24 04:52:52 +0000
@@ -15,7 +15,6 @@ skip-slave-start
[mysqld.2.slave]
server-id= 2
-init-rpl-role= slave
log-bin
skip-slave-start
ndb_connectstring= @mysql_cluster.slave.ndb_connectstring
=== removed file 'mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc'
--- a/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc 2009-12-22 09:35:56 +0000
+++ b/mysql-test/suite/sys_vars/inc/rpl_recovery_rank_basic.inc 1970-01-01 00:00:00 +0000
@@ -1,171 +0,0 @@
-############## mysql-test\t\rpl_recovery_rank_basic.test #######################
-# #
-# Variable Name: rpl_recovery_rank #
-# Scope: GLOBAL & SESSION #
-# Access Type: Dynamic #
-# Data Type: Numeric #
-# Default Value: 1 #
-# Range: 1 - 65536 #
-# #
-# #
-# Creation Date: 2008-02-07 #
-# Author: Rizwan Maredia #
-# #
-# Description: Test Cases of Dynamic System Variable rpl_recovery_rank #
-# that checks the behavior of this variable in the following ways #
-# * Default Value #
-# * Valid & Invalid values #
-# * Scope & Access method #
-# * Data Integrity #
-# #
-# Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
-# server-system-variables.html #
-# #
-################################################################################
-
---source include/load_sysvars.inc
-
-###################################################################
-# START OF rpl_recovery_rank TESTS #
-###################################################################
-
-
-#############################################################
-# Save initial value #
-#############################################################
-
-SET @start_global_value = @@global.rpl_recovery_rank;
-SELECT @start_global_value;
-
---echo '#--------------------FN_DYNVARS_142_01-------------------------#'
-###################################################################
-# Check the DEFAULT value of rpl_recovery_rank #
-###################################################################
-
-SET @@global.rpl_recovery_rank = 500000;
-SET @@global.rpl_recovery_rank = DEFAULT;
-SELECT @@global.rpl_recovery_rank;
-
---echo '#--------------------FN_DYNVARS_142_02-------------------------#'
-##################################################################################
-# Change the value of rpl_recovery_rank to a valid value for GLOBAL Scope #
-##################################################################################
-
-SET @@global.rpl_recovery_rank = 0;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 1024;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 123456789;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 2147483648*2;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 2147483648*1024;
-SELECT @@global.rpl_recovery_rank;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = 2147483648*2147483648;
-SELECT @@global.rpl_recovery_rank;
-
-
---echo '#--------------------FN_DYNVARS_142_03-------------------------#'
-#################################################################################
-# Check if variable can be access with session scope #
-#################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET @@rpl_recovery_rank = 2;
-
---Error ER_GLOBAL_VARIABLE
-SET @@session.rpl_recovery_rank = 3;
-
---Error ER_GLOBAL_VARIABLE
-SET @@local.rpl_recovery_rank = 4;
-
-
-
---echo '#------------------FN_DYNVARS_142_04-----------------------#'
-####################################################################
-# Change the value of rpl_recovery_rank to an invalid value #
-####################################################################
-
-SET @@global.rpl_recovery_rank = -1;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = -2147483648;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = -2147483649;
-SELECT @@global.rpl_recovery_rank;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 65530.34;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 2147483649.56;
---Error ER_WRONG_TYPE_FOR_VAR
-SET @@global.rpl_recovery_rank = 1G;
-
-
---echo '#------------------FN_DYNVARS_142_05-----------------------#'
-####################################################################
-# Check if the value in GLOBAL Table matches value in variable #
-####################################################################
-
-SET @@global.rpl_recovery_rank = 3000;
-SELECT @@global.rpl_recovery_rank = VARIABLE_VALUE
-FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-
-
---echo '#------------------FN_DYNVARS_142_06-----------------------#'
-###########################################################################
-# Check if the value is present in INFORMATION_SCHEMA.SESSION_VARIABLES #
-###########################################################################
-
-SELECT count(VARIABLE_VALUE)
-FROM INFORMATION_SCHEMA.SESSION_VARIABLES
-WHERE VARIABLE_NAME='rpl_recovery_rank';
-
-
---echo '#------------------FN_DYNVARS_142_07-----------------------#'
-####################################################################
-# Check if TRUE and FALSE values can be used on variable #
-####################################################################
-
-SET @@global.rpl_recovery_rank = TRUE;
-SELECT @@global.rpl_recovery_rank;
-SET @@global.rpl_recovery_rank = FALSE;
-SELECT @@global.rpl_recovery_rank;
-
-
---echo '#---------------------FN_DYNVARS_001_08----------------------#'
-#################################################################################
-# Check if accessing variable with and without GLOBAL point to same variable #
-#################################################################################
-
-
-SET @@global.rpl_recovery_rank = 512;
-SELECT @@rpl_recovery_rank = @@global.rpl_recovery_rank;
-
-
---echo '#---------------------FN_DYNVARS_001_09----------------------#'
-##################################################################################
-# Check if rpl_recovery_rank can be accessed without @@ sign and scope #
-##################################################################################
-
---Error ER_GLOBAL_VARIABLE
-SET rpl_recovery_rank = 2048;
---Error ER_BAD_FIELD_ERROR
-SELECT rpl_recovery_rank;
-
-SELECT @@rpl_recovery_rank;
-
-#verifying another another syntax for setting value
-SET global rpl_recovery_rank = 64;
-
-####################################
-# Restore initial value #
-####################################
-
-SET @@global.rpl_recovery_rank = @start_global_value;
-SELECT @@global.rpl_recovery_rank;
-
-########################################################
-# END OF rpl_recovery_rank TESTS #
-########################################################
-
=== removed file 'mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test'
--- a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test 2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_32.test 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 32 bit machines #
-################################################################################
-
---source include/have_32bit.inc
---source suite/sys_vars/inc/rpl_recovery_rank_basic.inc
-
=== removed file 'mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test'
--- a/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test 2008-07-23 14:06:44 +0000
+++ b/mysql-test/suite/sys_vars/t/rpl_recovery_rank_basic_64.test 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
-################################################################################
-# Created by Horst Hunger 2008-05-07 #
-# #
-# Wrapper for 64 bit machines #
-################################################################################
-
---source include/have_64bit.inc
---source suite/sys_vars/inc/rpl_recovery_rank_basic.inc
-
=== modified file 'mysql-test/t/variables.test'
--- a/mysql-test/t/variables.test 2010-06-17 07:22:36 +0000
+++ b/mysql-test/t/variables.test 2010-06-24 04:52:52 +0000
@@ -30,7 +30,6 @@ set @my_net_write_timeout =@@glo
set @my_net_read_timeout =@@global.net_read_timeout;
set @my_query_cache_limit =@@global.query_cache_limit;
set @my_query_cache_type =@@global.query_cache_type;
-set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
set @my_storage_engine =@@global.default_storage_engine;
@@ -329,7 +328,6 @@ set global query_cache_size=100;
set global query_cache_type=demand;
set read_buffer_size=100;
set read_rnd_buffer_size=100;
-set global rpl_recovery_rank=100;
set global server_id=100;
set global slow_launch_time=100;
set sort_buffer_size=100;
@@ -832,7 +830,6 @@ set global net_write_timeout =@m
set global net_read_timeout =@my_net_read_timeout;
set global query_cache_limit =@my_query_cache_limit;
set global query_cache_type =@my_query_cache_type;
-set global rpl_recovery_rank =@my_rpl_recovery_rank;
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
set global default_storage_engine =@my_storage_engine;
=== modified file 'sql/CMakeLists.txt'
--- a/sql/CMakeLists.txt 2010-06-23 04:30:46 +0000
+++ b/sql/CMakeLists.txt 2010-06-24 04:52:52 +0000
@@ -52,7 +52,7 @@ SET (SQL_SOURCE
mysqld.cc net_serv.cc keycaches.cc
opt_range.cc opt_range.h opt_sum.cc
../sql-common/pack.c parse_file.cc password.c procedure.cc
- protocol.cc records.cc repl_failsafe.cc set_var.cc
+ protocol.cc records.cc set_var.cc
sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc
sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc
sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h
=== modified file 'sql/Makefile.am'
--- a/sql/Makefile.am 2010-06-22 06:03:00 +0000
+++ b/sql/Makefile.am 2010-06-24 04:52:52 +0000
@@ -156,7 +156,6 @@ mysqld_SOURCES = sql_lex.cc sql_handler.
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
sql_union.cc sql_derived.cc \
sql_client.cc \
- repl_failsafe.h repl_failsafe.cc \
sql_olap.cc sql_view.cc \
gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
tztime.cc my_decimal.cc\
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2010-06-22 12:58:10 +0000
+++ b/sql/mysqld.cc 2010-06-24 04:52:52 +0000
@@ -57,7 +57,6 @@
#include "rpl_master.h"
#include "rpl_mi.h"
#include "rpl_filter.h"
-#include "repl_failsafe.h"
#include <my_stacktrace.h>
#include "mysqld_suffix.h"
#include "mysys_err.h"
@@ -541,7 +540,6 @@ ulong slow_launch_threads = 0;
uint sync_binlog_period= 0, sync_relaylog_period= 0,
sync_relayloginfo_period= 0, sync_masterinfo_period= 0;
ulong expire_logs_days = 0;
-ulong rpl_recovery_rank=0;
const double log_10[] = {
1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009,
@@ -1622,10 +1620,6 @@ static void clean_up_mutexes()
OPENSSL_free(openssl_stdlocks);
#endif
#endif
-#ifdef HAVE_REPLICATION
- mysql_mutex_destroy(&LOCK_rpl_status);
- mysql_cond_destroy(&COND_rpl_status);
-#endif
mysql_mutex_destroy(&LOCK_active_mi);
mysql_rwlock_destroy(&LOCK_sys_init_connect);
mysql_rwlock_destroy(&LOCK_sys_init_slave);
@@ -3837,10 +3831,6 @@ static int init_thread_environment()
mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL);
mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL);
mysql_cond_init(key_COND_manager, &COND_manager, NULL);
-#ifdef HAVE_REPLICATION
- mysql_mutex_init(key_LOCK_rpl_status, &LOCK_rpl_status, MY_MUTEX_INIT_FAST);
- mysql_cond_init(key_COND_rpl_status, &COND_rpl_status, NULL);
-#endif
mysql_mutex_init(key_LOCK_server_started,
&LOCK_server_started, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_COND_server_started, &COND_server_started, NULL);
@@ -6306,9 +6296,6 @@ struct my_option my_long_options[]=
&master_retry_count, &master_retry_count, 0, GET_ULONG,
REQUIRED_ARG, 3600*24, 0, 0, 0, 0, 0},
#ifdef HAVE_REPLICATION
- {"init-rpl-role", 0, "Set the replication role.",
- &rpl_status, &rpl_status, &rpl_role_typelib,
- GET_ENUM, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"max-binlog-dump-events", 0,
"Option used by mysql-test for debugging and testing of replication.",
&max_binlog_dump_events, &max_binlog_dump_events, 0,
@@ -6532,13 +6519,6 @@ static int show_flushstatustime(THD *thd
#endif
#ifdef HAVE_REPLICATION
-static int show_rpl_status(THD *thd, SHOW_VAR *var, char *buff)
-{
- var->type= SHOW_CHAR;
- var->value= const_cast<char*>(rpl_status_type[(int)rpl_status]);
- return 0;
-}
-
static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff)
{
var->type= SHOW_MY_BOOL;
@@ -6958,9 +6938,6 @@ SHOW_VAR status_vars[]= {
#endif /*HAVE_QUERY_CACHE*/
{"Queries", (char*) &show_queries, SHOW_FUNC},
{"Questions", (char*) offsetof(STATUS_VAR, questions), SHOW_LONG_STATUS},
-#ifdef HAVE_REPLICATION
- {"Rpl_status", (char*) &show_rpl_status, SHOW_FUNC},
-#endif
{"Select_full_join", (char*) offsetof(STATUS_VAR, select_full_join_count), SHOW_LONG_STATUS},
{"Select_full_range_join", (char*) offsetof(STATUS_VAR, select_full_range_join_count), SHOW_LONG_STATUS},
{"Select_range", (char*) offsetof(STATUS_VAR, select_range_count), SHOW_LONG_STATUS},
@@ -8168,7 +8145,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key
key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables,
key_LOCK_lock_db, key_LOCK_manager, key_LOCK_mapped_file,
key_LOCK_mysql_create_db, key_LOCK_open, key_LOCK_prepared_stmt_count,
- key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status,
+ key_LOCK_server_started, key_LOCK_status,
key_LOCK_system_variables_hash, key_LOCK_table_share, key_LOCK_thd_data,
key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log,
key_master_info_data_lock, key_master_info_run_lock,
@@ -8211,7 +8188,6 @@ static PSI_mutex_info all_server_mutexes
{ &key_LOCK_mysql_create_db, "LOCK_mysql_create_db", PSI_FLAG_GLOBAL},
{ &key_LOCK_open, "LOCK_open", PSI_FLAG_GLOBAL},
{ &key_LOCK_prepared_stmt_count, "LOCK_prepared_stmt_count", PSI_FLAG_GLOBAL},
- { &key_LOCK_rpl_status, "LOCK_rpl_status", PSI_FLAG_GLOBAL},
{ &key_LOCK_server_started, "LOCK_server_started", PSI_FLAG_GLOBAL},
{ &key_LOCK_status, "LOCK_status", PSI_FLAG_GLOBAL},
{ &key_LOCK_system_variables_hash, "LOCK_system_variables_hash", PSI_FLAG_GLOBAL},
@@ -8257,7 +8233,7 @@ PSI_cond_key key_PAGE_cond, key_COND_act
PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_COND_cache_status_changed, key_COND_global_read_lock, key_COND_manager,
- key_COND_refresh, key_COND_rpl_status, key_COND_server_started,
+ key_COND_refresh, key_COND_server_started,
key_delayed_insert_cond, key_delayed_insert_cond_client,
key_item_func_sleep_cond, key_master_info_data_cond,
key_master_info_start_cond, key_master_info_stop_cond,
@@ -8282,7 +8258,6 @@ static PSI_cond_info all_server_conds[]=
{ &key_COND_global_read_lock, "COND_global_read_lock", PSI_FLAG_GLOBAL},
{ &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL},
{ &key_COND_refresh, "COND_refresh", PSI_FLAG_GLOBAL},
- { &key_COND_rpl_status, "COND_rpl_status", PSI_FLAG_GLOBAL},
{ &key_COND_server_started, "COND_server_started", PSI_FLAG_GLOBAL},
{ &key_delayed_insert_cond, "Delayed_insert::cond", 0},
{ &key_delayed_insert_cond_client, "Delayed_insert::cond_client", 0},
=== modified file 'sql/mysqld.h'
--- a/sql/mysqld.h 2010-06-22 09:34:59 +0000
+++ b/sql/mysqld.h 2010-06-24 04:52:52 +0000
@@ -183,7 +183,7 @@ extern ulong binlog_cache_size, open_fil
extern ulonglong max_binlog_cache_size;
extern ulong max_binlog_size, max_relay_log_size;
extern ulong opt_binlog_rows_event_max_size;
-extern ulong rpl_recovery_rank, thread_cache_size, thread_pool_size;
+extern ulong thread_cache_size, thread_pool_size;
extern ulong back_log;
extern char language[FN_REFLEN];
extern ulong server_id, concurrency;
@@ -240,7 +240,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_ind
key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables,
key_LOCK_lock_db, key_LOCK_logger, key_LOCK_manager, key_LOCK_mapped_file,
key_LOCK_mysql_create_db, key_LOCK_open, key_LOCK_prepared_stmt_count,
- key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status,
+ key_LOCK_server_started, key_LOCK_status,
key_LOCK_table_share, key_LOCK_thd_data,
key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log,
key_master_info_data_lock, key_master_info_run_lock,
@@ -259,7 +259,7 @@ extern PSI_cond_key key_PAGE_cond, key_C
extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond,
key_COND_cache_status_changed, key_COND_global_read_lock, key_COND_manager,
- key_COND_refresh, key_COND_rpl_status, key_COND_server_started,
+ key_COND_refresh, key_COND_server_started,
key_delayed_insert_cond, key_delayed_insert_cond_client,
key_item_func_sleep_cond, key_master_info_data_cond,
key_master_info_start_cond, key_master_info_stop_cond,
=== removed file 'sql/repl_failsafe.cc'
--- a/sql/repl_failsafe.cc 2010-06-22 12:58:10 +0000
+++ b/sql/repl_failsafe.cc 1970-01-01 00:00:00 +0000
@@ -1,751 +0,0 @@
-/* Copyright (C) 2001-2006 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-/**
- @file
-
- All of the functions defined in this file which are not used (the ones to
- handle failsafe) are not used; their code has not been updated for more
- than one year now so should be considered as BADLY BROKEN. Do not enable
- it. The used functions (to handle LOAD DATA FROM MASTER, plus some small
- functions like register_slave()) are working.
-*/
-
-#include "sql_priv.h"
-#include "sql_parse.h" // check_access
-#ifdef HAVE_REPLICATION
-
-#include "repl_failsafe.h"
-#include "sql_acl.h" // REPL_SLAVE_ACL
-#include "rpl_master.h"
-#include "rpl_slave.h"
-#include "rpl_mi.h"
-#include "rpl_filter.h"
-#include "log_event.h"
-#include "sql_db.h" // mysql_create_db
-#include <mysql.h>
-
-#define SLAVE_LIST_CHUNK 128
-#define SLAVE_ERRMSG_SIZE (FN_REFLEN+64)
-
-
-RPL_STATUS rpl_status=RPL_NULL;
-mysql_mutex_t LOCK_rpl_status;
-mysql_cond_t COND_rpl_status;
-HASH slave_list;
-
-const char *rpl_role_type[] = {"MASTER","SLAVE",NullS};
-TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-1,"",
- rpl_role_type, NULL};
-
-const char* rpl_status_type[]=
-{
- "AUTH_MASTER","IDLE_SLAVE","ACTIVE_SLAVE","LOST_SOLDIER","TROOP_SOLDIER",
- "RECOVERY_CAPTAIN","NULL",NullS
-};
-TYPELIB rpl_status_typelib= {array_elements(rpl_status_type)-1,"",
- rpl_status_type, NULL};
-
-
-static Slave_log_event* find_slave_event(IO_CACHE* log,
- const char* log_file_name,
- char* errmsg);
-
-/*
- All of the functions defined in this file which are not used (the ones to
- handle failsafe) are not used; their code has not been updated for more than
- one year now so should be considered as BADLY BROKEN. Do not enable it.
- The used functions (to handle LOAD DATA FROM MASTER, plus some small
- functions like register_slave()) are working.
-*/
-
-#if NOT_USED
-static int init_failsafe_rpl_thread(THD* thd)
-{
- DBUG_ENTER("init_failsafe_rpl_thread");
- thd->system_thread = SYSTEM_THREAD_DELAYED_INSERT;
- /*
- thd->bootstrap is to report errors barely to stderr; if this code is
- enable again one day, one should check if bootstrap is still needed (maybe
- this thread has no other error reporting method).
- */
- thd->bootstrap = 1;
- thd->security_ctx->skip_grants();
- my_net_init(&thd->net, 0);
- thd->net.read_timeout = slave_net_timeout;
- thd->max_client_packet_length=thd->net.max_packet;
- mysql_mutex_lock(&LOCK_thread_count);
- thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
- mysql_mutex_unlock(&LOCK_thread_count);
-
- if (init_thr_lock() || thd->store_globals())
- {
- /* purecov: begin inspected */
- close_connection(thd, ER_OUT_OF_RESOURCES, 1); // is this needed?
- statistic_increment(aborted_connects,&LOCK_status);
- one_thread_per_connection_end(thd,0);
- DBUG_RETURN(-1);
- /* purecov: end */
- }
-
- thd->mem_root->free= thd->mem_root->used= 0;
- thd_proc_info(thd, "Thread initialized");
- thd->version=refresh_version;
- thd->set_time();
- DBUG_RETURN(0);
-}
-#endif
-
-void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status)
-{
- mysql_mutex_lock(&LOCK_rpl_status);
- if (rpl_status == from_status || rpl_status == RPL_ANY)
- rpl_status = to_status;
- mysql_cond_signal(&COND_rpl_status);
- mysql_mutex_unlock(&LOCK_rpl_status);
-}
-
-
-#define get_object(p, obj, msg) \
-{\
- uint len = (uint)*p++; \
- if (p + len > p_end || len >= sizeof(obj)) \
- {\
- errmsg= msg;\
- goto err; \
- }\
- strmake(obj,(char*) p,len); \
- p+= len; \
-}\
-
-
-static inline int cmp_master_pos(Slave_log_event* sev, LEX_MASTER_INFO* mi)
-{
- return cmp_master_pos(sev->master_log, sev->master_pos, mi->log_file_name,
- mi->pos);
-}
-
-
-void unregister_slave(THD* thd, bool only_mine, bool need_mutex)
-{
- if (thd->server_id)
- {
- if (need_mutex)
- mysql_mutex_lock(&LOCK_slave_list);
-
- SLAVE_INFO* old_si;
- if ((old_si = (SLAVE_INFO*)my_hash_search(&slave_list,
- (uchar*)&thd->server_id, 4)) &&
- (!only_mine || old_si->thd == thd))
- my_hash_delete(&slave_list, (uchar*)old_si);
-
- if (need_mutex)
- mysql_mutex_unlock(&LOCK_slave_list);
- }
-}
-
-
-/**
- Register slave in 'slave_list' hash table.
-
- @return
- 0 ok
- @return
- 1 Error. Error message sent to client
-*/
-
-int register_slave(THD* thd, uchar* packet, uint packet_length)
-{
- int res;
- SLAVE_INFO *si;
- uchar *p= packet, *p_end= packet + packet_length;
- const char *errmsg= "Wrong parameters to function register_slave";
-
- if (check_access(thd, REPL_SLAVE_ACL, any_db, NULL, NULL, 0, 0))
- return 1;
- if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME))))
- goto err2;
-
- thd->server_id= si->server_id= uint4korr(p);
- p+= 4;
- get_object(p,si->host, "Failed to register slave: too long 'report-host'");
- get_object(p,si->user, "Failed to register slave: too long 'report-user'");
- get_object(p,si->password, "Failed to register slave; too long 'report-password'");
- if (p+10 > p_end)
- goto err;
- si->port= uint2korr(p);
- p += 2;
- /*
- We need to by pass the bytes used in the fake rpl_recovery_rank
- variable. It was removed in patch for BUG#13963. But this would
- make a server with that patch unable to connect to an old master.
- See: BUG#49259
- */
- // si->rpl_recovery_rank= uint4korr(p);
- p += 4;
- if (!(si->master_id= uint4korr(p)))
- si->master_id= server_id;
- si->thd= thd;
-
- mysql_mutex_lock(&LOCK_slave_list);
- unregister_slave(thd,0,0);
- res= my_hash_insert(&slave_list, (uchar*) si);
- mysql_mutex_unlock(&LOCK_slave_list);
- return res;
-
-err:
- my_free(si, MYF(MY_WME));
- my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); /* purecov: inspected */
-err2:
- return 1;
-}
-
-extern "C" uint32
-*slave_list_key(SLAVE_INFO* si, size_t *len,
- my_bool not_used __attribute__((unused)))
-{
- *len = 4;
- return &si->server_id;
-}
-
-extern "C" void slave_info_free(void *s)
-{
- my_free(s, MYF(MY_WME));
-}
-
-#ifdef HAVE_PSI_INTERFACE
-static PSI_mutex_key key_LOCK_slave_list;
-
-static PSI_mutex_info all_slave_list_mutexes[]=
-{
- { &key_LOCK_slave_list, "LOCK_slave_list", PSI_FLAG_GLOBAL}
-};
-
-static void init_all_slave_list_mutexes(void)
-{
- const char* category= "sql";
- int count;
-
- if (PSI_server == NULL)
- return;
-
- count= array_elements(all_slave_list_mutexes);
- PSI_server->register_mutex(category, all_slave_list_mutexes, count);
-}
-#endif /* HAVE_PSI_INTERFACE */
-
-void init_slave_list()
-{
-#ifdef HAVE_PSI_INTERFACE
- init_all_slave_list_mutexes();
-#endif
-
- my_hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0,
- (my_hash_get_key) slave_list_key,
- (my_hash_free_key) slave_info_free, 0);
- mysql_mutex_init(key_LOCK_slave_list, &LOCK_slave_list, MY_MUTEX_INIT_FAST);
-}
-
-void end_slave_list()
-{
- /* No protection by a mutex needed as we are only called at shutdown */
- if (my_hash_inited(&slave_list))
- {
- my_hash_free(&slave_list);
- mysql_mutex_destroy(&LOCK_slave_list);
- }
-}
-
-static int find_target_pos(LEX_MASTER_INFO *mi, IO_CACHE *log, char *errmsg)
-{
- my_off_t log_pos = (my_off_t) mi->pos;
- uint32 target_server_id = mi->server_id;
-
- for (;;)
- {
- Log_event* ev;
- if (!(ev= Log_event::read_log_event(log, (mysql_mutex_t*) 0, 0)))
- {
- if (log->error > 0)
- strmov(errmsg, "Binary log truncated in the middle of event");
- else if (log->error < 0)
- strmov(errmsg, "I/O error reading binary log");
- else
- strmov(errmsg, "Could not find target event in the binary log");
- return 1;
- }
-
- if (ev->log_pos >= log_pos && ev->server_id == target_server_id)
- {
- delete ev;
- mi->pos = my_b_tell(log);
- return 0;
- }
- delete ev;
- }
- /* Impossible */
-}
-
-/**
- @details
- Before 4.0.15 we had a member of THD called log_pos, it was meant for
- failsafe replication code in repl_failsafe.cc which is disabled until
- it is reworked. Event's log_pos used to be preserved through
- log-slave-updates to make code in repl_failsafe.cc work (this
- function, SHOW NEW MASTER); but on the other side it caused unexpected
- values in Exec_Master_Log_Pos in A->B->C replication setup,
- synchronization problems in master_pos_wait(), ... So we
- (Dmitri & Guilhem) removed it.
-
- So for now this function is broken.
-*/
-
-int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
-{
- LOG_INFO linfo;
- char last_log_name[FN_REFLEN];
- IO_CACHE log;
- File file = -1, last_file = -1;
- mysql_mutex_t *log_lock;
- const char* errmsg_p;
- Slave_log_event* sev = 0;
- my_off_t last_pos = 0;
- int error = 1;
- int cmp_res;
- LINT_INIT(cmp_res);
- DBUG_ENTER("translate_master");
-
- if (!mysql_bin_log.is_open())
- {
- strmov(errmsg,"Binary log is not open");
- DBUG_RETURN(1);
- }
-
- if (!server_id_supplied)
- {
- strmov(errmsg, "Misconfigured master - server id was not set");
- DBUG_RETURN(1);
- }
-
- if (mysql_bin_log.find_log_pos(&linfo, NullS, 1))
- {
- strmov(errmsg,"Could not find first log");
- DBUG_RETURN(1);
- }
- thd->current_linfo = &linfo;
-
- bzero((char*) &log,sizeof(log));
- log_lock = mysql_bin_log.get_log_lock();
- mysql_mutex_lock(log_lock);
-
- for (;;)
- {
- if ((file=open_binlog(&log, linfo.log_file_name, &errmsg_p)) < 0)
- {
- strmov(errmsg, errmsg_p);
- goto err;
- }
-
- if (!(sev = find_slave_event(&log, linfo.log_file_name, errmsg)))
- goto err;
-
- cmp_res = cmp_master_pos(sev, mi);
- delete sev;
-
- if (!cmp_res)
- {
- /* Copy basename */
- fn_format(mi->log_file_name, linfo.log_file_name, "","",1);
- mi->pos = my_b_tell(&log);
- goto mi_inited;
- }
- else if (cmp_res > 0)
- {
- if (!last_pos)
- {
- strmov(errmsg,
- "Slave event in first log points past the target position");
- goto err;
- }
- end_io_cache(&log);
- mysql_file_close(file, MYF(MY_WME));
- if (init_io_cache(&log, (file = last_file), IO_SIZE, READ_CACHE, 0, 0,
- MYF(MY_WME)))
- {
- errmsg[0] = 0;
- goto err;
- }
- break;
- }
-
- strmov(last_log_name, linfo.log_file_name);
- last_pos = my_b_tell(&log);
-
- switch (mysql_bin_log.find_next_log(&linfo, 1)) {
- case LOG_INFO_EOF:
- if (last_file >= 0)
- mysql_file_close(last_file, MYF(MY_WME));
- last_file = -1;
- goto found_log;
- case 0:
- break;
- default:
- strmov(errmsg, "Error reading log index");
- goto err;
- }
-
- end_io_cache(&log);
- if (last_file >= 0)
- mysql_file_close(last_file, MYF(MY_WME));
- last_file = file;
- }
-
-found_log:
- my_b_seek(&log, last_pos);
- if (find_target_pos(mi,&log,errmsg))
- goto err;
- fn_format(mi->log_file_name, last_log_name, "","",1); /* Copy basename */
-
-mi_inited:
- error = 0;
-err:
- mysql_mutex_unlock(log_lock);
- end_io_cache(&log);
- mysql_mutex_lock(&LOCK_thread_count);
- thd->current_linfo = 0;
- mysql_mutex_unlock(&LOCK_thread_count);
- if (file >= 0)
- mysql_file_close(file, MYF(MY_WME));
- if (last_file >= 0 && last_file != file)
- mysql_file_close(last_file, MYF(MY_WME));
-
- DBUG_RETURN(error);
-}
-
-
-/**
- Caller must delete result when done.
-*/
-
-static Slave_log_event* find_slave_event(IO_CACHE* log,
- const char* log_file_name,
- char* errmsg)
-{
- Log_event* ev;
- int i;
- bool slave_event_found = 0;
- LINT_INIT(ev);
-
- for (i = 0; i < 2; i++)
- {
- if (!(ev= Log_event::read_log_event(log, (mysql_mutex_t*)0, 0)))
- {
- my_snprintf(errmsg, SLAVE_ERRMSG_SIZE,
- "Error reading event in log '%s'",
- (char*)log_file_name);
- return 0;
- }
- if (ev->get_type_code() == SLAVE_EVENT)
- {
- slave_event_found = 1;
- break;
- }
- delete ev;
- }
- if (!slave_event_found)
- {
- my_snprintf(errmsg, SLAVE_ERRMSG_SIZE,
- "Could not find slave event in log '%s'",
- (char*)log_file_name);
- return 0;
- }
-
- return (Slave_log_event*)ev;
-}
-
-/**
- This function is broken now.
-
- @seealso translate_master()
-*/
-
-bool show_new_master(THD* thd)
-{
- Protocol *protocol= thd->protocol;
- DBUG_ENTER("show_new_master");
- List<Item> field_list;
- char errmsg[SLAVE_ERRMSG_SIZE];
- LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
-
- errmsg[0]=0; // Safety
- if (translate_master(thd, lex_mi, errmsg))
- {
- if (errmsg[0])
- my_error(ER_ERROR_WHEN_EXECUTING_COMMAND, MYF(0),
- "SHOW NEW MASTER", errmsg);
- DBUG_RETURN(TRUE);
- }
- else
- {
- field_list.push_back(new Item_empty_string("Log_name", 20));
- field_list.push_back(new Item_return_int("Log_pos", 10,
- MYSQL_TYPE_LONGLONG));
- if (protocol->send_result_set_metadata(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
- protocol->prepare_for_resend();
- protocol->store(lex_mi->log_file_name, &my_charset_bin);
- protocol->store((ulonglong) lex_mi->pos);
- if (protocol->write())
- DBUG_RETURN(TRUE);
- my_eof(thd);
- DBUG_RETURN(FALSE);
- }
-}
-
-/**
- Asks the master for the list of its other connected slaves.
-
- This is for failsafe replication:
- in order for failsafe replication to work, the servers involved in
- replication must know of each other. We accomplish this by having each
- slave report to the master how to reach it, and on connection, each
- slave receives information about where the other slaves are.
-
- @param mysql pre-existing connection to the master
- @param mi master info
-
- @note
- mi is used only to give detailed error messages which include the
- hostname/port of the master, the username used by the slave to connect to
- the master.
- If the user used by the slave to connect to the master does not have the
- REPLICATION SLAVE privilege, it will pop in this function because
- SHOW SLAVE HOSTS will fail on the master.
-
- @retval
- 1 error
- @retval
- 0 success
-*/
-
-int update_slave_list(MYSQL* mysql, Master_info* mi)
-{
- MYSQL_RES* res=0;
- MYSQL_ROW row;
- const char* error=0;
- bool have_auth_info;
- int port_ind;
- DBUG_ENTER("update_slave_list");
-
- if (mysql_real_query(mysql, STRING_WITH_LEN("SHOW SLAVE HOSTS")) ||
- !(res = mysql_store_result(mysql)))
- {
- error= mysql_error(mysql);
- goto err;
- }
-
- switch (mysql_num_fields(res)) {
- case 5:
- have_auth_info = 0;
- port_ind=2;
- break;
- case 7:
- have_auth_info = 1;
- port_ind=4;
- break;
- default:
- error= "the master returned an invalid number of fields for SHOW SLAVE \
-HOSTS";
- goto err;
- }
-
- mysql_mutex_lock(&LOCK_slave_list);
-
- while ((row= mysql_fetch_row(res)))
- {
- uint32 log_server_id;
- SLAVE_INFO* si, *old_si;
- log_server_id = atoi(row[0]);
- if ((old_si= (SLAVE_INFO*)my_hash_search(&slave_list,
- (uchar*)&log_server_id,4)))
- si = old_si;
- else
- {
- if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME))))
- {
- error= "the slave is out of memory";
- mysql_mutex_unlock(&LOCK_slave_list);
- goto err;
- }
- si->server_id = log_server_id;
- if (my_hash_insert(&slave_list, (uchar*)si))
- {
- error= "the slave is out of memory";
- mysql_mutex_unlock(&LOCK_slave_list);
- goto err;
- }
- }
- strmake(si->host, row[1], sizeof(si->host)-1);
- si->port = atoi(row[port_ind]);
- si->rpl_recovery_rank = atoi(row[port_ind+1]);
- si->master_id = atoi(row[port_ind+2]);
- if (have_auth_info)
- {
- strmake(si->user, row[2], sizeof(si->user)-1);
- strmake(si->password, row[3], sizeof(si->password)-1);
- }
- }
- mysql_mutex_unlock(&LOCK_slave_list);
-
-err:
- if (res)
- mysql_free_result(res);
- if (error)
- {
- sql_print_error("While trying to obtain the list of slaves from the master "
- "'%s:%d', user '%s' got the following error: '%s'",
- mi->host, mi->port, mi->user, error);
- DBUG_RETURN(1);
- }
- DBUG_RETURN(0);
-}
-
-
-#if NOT_USED
-int find_recovery_captain(THD* thd, MYSQL* mysql)
-{
- return 0;
-}
-#endif
-
-#if NOT_USED
-pthread_handler_t handle_failsafe_rpl(void *arg)
-{
- DBUG_ENTER("handle_failsafe_rpl");
- THD *thd = new THD;
- thd->thread_stack = (char*)&thd;
- MYSQL* recovery_captain = 0;
- const char* msg;
-
- pthread_detach_this_thread();
- if (init_failsafe_rpl_thread(thd) || !(recovery_captain=mysql_init(0)))
- {
- sql_print_error("Could not initialize failsafe replication thread");
- goto err;
- }
- mysql_mutex_lock(&LOCK_rpl_status);
- msg= thd->enter_cond(&COND_rpl_status,
- &LOCK_rpl_status, "Waiting for request");
- while (!thd->killed && !abort_loop)
- {
- bool break_req_chain = 0;
- mysql_cond_wait(&COND_rpl_status, &LOCK_rpl_status);
- thd_proc_info(thd, "Processing request");
- while (!break_req_chain)
- {
- switch (rpl_status) {
- case RPL_LOST_SOLDIER:
- if (find_recovery_captain(thd, recovery_captain))
- rpl_status=RPL_TROOP_SOLDIER;
- else
- rpl_status=RPL_RECOVERY_CAPTAIN;
- break_req_chain=1; /* for now until other states are implemented */
- break;
- default:
- break_req_chain=1;
- break;
- }
- }
- }
- thd->exit_cond(msg);
-err:
- if (recovery_captain)
- mysql_close(recovery_captain);
- delete thd;
-
- DBUG_LEAVE; // Must match DBUG_ENTER()
- my_thread_end();
- pthread_exit(0);
- return 0; // Avoid compiler warnings
-}
-#endif
-
-
-/**
- Execute a SHOW SLAVE HOSTS statement.
-
- @param thd Pointer to THD object for the client thread executing the
- statement.
-
- @retval FALSE success
- @retval TRUE failure
-*/
-bool show_slave_hosts(THD* thd)
-{
- List<Item> field_list;
- Protocol *protocol= thd->protocol;
- DBUG_ENTER("show_slave_hosts");
-
- field_list.push_back(new Item_return_int("Server_id", 10,
- MYSQL_TYPE_LONG));
- field_list.push_back(new Item_empty_string("Host", 20));
- if (opt_show_slave_auth_info)
- {
- field_list.push_back(new Item_empty_string("User",20));
- field_list.push_back(new Item_empty_string("Password",20));
- }
- field_list.push_back(new Item_return_int("Port", 7, MYSQL_TYPE_LONG));
- field_list.push_back(new Item_return_int("Master_id", 10,
- MYSQL_TYPE_LONG));
- field_list.push_back(new Item_empty_string("Slave_UUID", UUID_LENGTH));
-
- if (protocol->send_result_set_metadata(&field_list,
- Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
- DBUG_RETURN(TRUE);
-
- mysql_mutex_lock(&LOCK_slave_list);
-
- for (uint i = 0; i < slave_list.records; ++i)
- {
- SLAVE_INFO* si = (SLAVE_INFO*) my_hash_element(&slave_list, i);
- protocol->prepare_for_resend();
- protocol->store((uint32) si->server_id);
- protocol->store(si->host, &my_charset_bin);
- if (opt_show_slave_auth_info)
- {
- protocol->store(si->user, &my_charset_bin);
- protocol->store(si->password, &my_charset_bin);
- }
- protocol->store((uint32) si->port);
- protocol->store((uint32) si->master_id);
-
- /* get slave's UUID */
- String slave_uuid;
- if (get_slave_uuid(si->thd, &slave_uuid));
- protocol->store(slave_uuid.c_ptr_safe(), &my_charset_bin);
- if (protocol->write())
- {
- mysql_mutex_unlock(&LOCK_slave_list);
- DBUG_RETURN(TRUE);
- }
- }
- mysql_mutex_unlock(&LOCK_slave_list);
- my_eof(thd);
- DBUG_RETURN(FALSE);
-}
-
-#endif /* HAVE_REPLICATION */
-
=== removed file 'sql/repl_failsafe.h'
--- a/sql/repl_failsafe.h 2010-06-22 06:03:00 +0000
+++ b/sql/repl_failsafe.h 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
-#ifndef REPL_FAILSAFE_INCLUDED
-#define REPL_FAILSAFE_INCLUDED
-
-/* Copyright (C) 2001-2005 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-
-#ifdef HAVE_REPLICATION
-
-#include "mysql.h"
-#include "my_sys.h"
-#include "rpl_slave.h"
-
-typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE,
- RPL_LOST_SOLDIER,RPL_TROOP_SOLDIER,
- RPL_RECOVERY_CAPTAIN,RPL_NULL /* inactive */,
- RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS;
-extern RPL_STATUS rpl_status;
-
-extern mysql_mutex_t LOCK_rpl_status;
-extern mysql_cond_t COND_rpl_status;
-extern TYPELIB rpl_role_typelib, rpl_status_typelib;
-extern const char* rpl_role_type[], *rpl_status_type[];
-
-pthread_handler_t handle_failsafe_rpl(void *arg);
-void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status);
-int find_recovery_captain(THD* thd, MYSQL* mysql);
-int update_slave_list(MYSQL* mysql, Master_info* mi);
-
-extern HASH slave_list;
-
-bool load_master_data(THD* thd);
-int connect_to_master(THD *thd, MYSQL* mysql, Master_info* mi);
-
-bool show_new_master(THD* thd);
-bool show_slave_hosts(THD* thd);
-int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg);
-void init_slave_list();
-void end_slave_list();
-int register_slave(THD* thd, uchar* packet, uint packet_length);
-void unregister_slave(THD* thd, bool only_mine, bool need_mutex);
-
-#endif /* HAVE_REPLICATION */
-#endif /* REPL_FAILSAFE_INCLUDED */
=== modified file 'sql/rpl_master.cc'
--- a/sql/rpl_master.cc 2010-06-22 12:58:10 +0000
+++ b/sql/rpl_master.cc 2010-06-24 04:52:52 +0000
@@ -28,11 +28,232 @@
int max_binlog_dump_events = 0; // unlimited
my_bool opt_sporadic_binlog_dump_fail = 0;
+extern my_bool opt_show_slave_auth_info;
#ifndef DBUG_OFF
static int binlog_dump_count = 0;
#endif
+#define SLAVE_LIST_CHUNK 128
+#define SLAVE_ERRMSG_SIZE (FN_REFLEN+64)
+HASH slave_list;
+
+#define get_object(p, obj, msg) \
+{\
+ uint len = (uint)*p++; \
+ if (p + len > p_end || len >= sizeof(obj)) \
+ {\
+ errmsg= msg;\
+ goto err; \
+ }\
+ strmake(obj,(char*) p,len); \
+ p+= len; \
+}\
+
+typedef struct st_slave_info
+{
+ uint32 server_id;
+ uint32 master_id;
+ char host[HOSTNAME_LENGTH+1];
+ char user[USERNAME_LENGTH+1];
+ char password[MAX_PASSWORD_LENGTH+1];
+ uint16 port;
+ THD* thd;
+} SLAVE_INFO;
+
+extern "C" uint32
+*slave_list_key(SLAVE_INFO* si, size_t *len,
+ my_bool not_used __attribute__((unused)))
+{
+ *len = 4;
+ return &si->server_id;
+}
+
+extern "C" void slave_info_free(void *s)
+{
+ my_free(s, MYF(MY_WME));
+}
+
+#ifdef HAVE_PSI_INTERFACE
+static PSI_mutex_key key_LOCK_slave_list;
+
+static PSI_mutex_info all_slave_list_mutexes[]=
+{
+ { &key_LOCK_slave_list, "LOCK_slave_list", PSI_FLAG_GLOBAL}
+};
+
+static void init_all_slave_list_mutexes(void)
+{
+ const char* category= "sql";
+ int count;
+
+ if (PSI_server == NULL)
+ return;
+
+ count= array_elements(all_slave_list_mutexes);
+ PSI_server->register_mutex(category, all_slave_list_mutexes, count);
+}
+#endif /* HAVE_PSI_INTERFACE */
+
+void init_slave_list()
+{
+#ifdef HAVE_PSI_INTERFACE
+ init_all_slave_list_mutexes();
+#endif
+
+ my_hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0,
+ (my_hash_get_key) slave_list_key,
+ (my_hash_free_key) slave_info_free, 0);
+ mysql_mutex_init(key_LOCK_slave_list, &LOCK_slave_list, MY_MUTEX_INIT_FAST);
+}
+
+void end_slave_list()
+{
+ /* No protection by a mutex needed as we are only called at shutdown */
+ if (my_hash_inited(&slave_list))
+ {
+ my_hash_free(&slave_list);
+ mysql_mutex_destroy(&LOCK_slave_list);
+ }
+}
+
+/**
+ Register slave in 'slave_list' hash table.
+
+ @return
+ 0 ok
+ @return
+ 1 Error. Error message sent to client
+*/
+
+int register_slave(THD* thd, uchar* packet, uint packet_length)
+{
+ int res;
+ SLAVE_INFO *si;
+ uchar *p= packet, *p_end= packet + packet_length;
+ const char *errmsg= "Wrong parameters to function register_slave";
+
+ if (check_access(thd, REPL_SLAVE_ACL, any_db, NULL, NULL, 0, 0))
+ return 1;
+ if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME))))
+ goto err2;
+
+ thd->server_id= si->server_id= uint4korr(p);
+ p+= 4;
+ get_object(p,si->host, "Failed to register slave: too long 'report-host'");
+ get_object(p,si->user, "Failed to register slave: too long 'report-user'");
+ get_object(p,si->password, "Failed to register slave; too long 'report-password'");
+ if (p+10 > p_end)
+ goto err;
+ si->port= uint2korr(p);
+ p += 2;
+ /*
+ We need to by pass the bytes used in the fake rpl_recovery_rank
+ variable. It was removed in patch for BUG#13963. But this would
+ make a server with that patch unable to connect to an old master.
+ See: BUG#49259
+ */
+ p += 4;
+ if (!(si->master_id= uint4korr(p)))
+ si->master_id= server_id;
+ si->thd= thd;
+
+ mysql_mutex_lock(&LOCK_slave_list);
+ unregister_slave(thd,0,0);
+ res= my_hash_insert(&slave_list, (uchar*) si);
+ mysql_mutex_unlock(&LOCK_slave_list);
+ return res;
+
+err:
+ my_free(si, MYF(MY_WME));
+ my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0)); /* purecov: inspected */
+err2:
+ return 1;
+}
+
+void unregister_slave(THD* thd, bool only_mine, bool need_mutex)
+{
+ if (thd->server_id)
+ {
+ if (need_mutex)
+ mysql_mutex_lock(&LOCK_slave_list);
+
+ SLAVE_INFO* old_si;
+ if ((old_si = (SLAVE_INFO*)my_hash_search(&slave_list,
+ (uchar*)&thd->server_id, 4)) &&
+ (!only_mine || old_si->thd == thd))
+ my_hash_delete(&slave_list, (uchar*)old_si);
+
+ if (need_mutex)
+ mysql_mutex_unlock(&LOCK_slave_list);
+ }
+}
+
+
+/**
+ Execute a SHOW SLAVE HOSTS statement.
+
+ @param thd Pointer to THD object for the client thread executing the
+ statement.
+
+ @retval FALSE success
+ @retval TRUE failure
+*/
+bool show_slave_hosts(THD* thd)
+{
+ List<Item> field_list;
+ Protocol *protocol= thd->protocol;
+ DBUG_ENTER("show_slave_hosts");
+
+ field_list.push_back(new Item_return_int("Server_id", 10,
+ MYSQL_TYPE_LONG));
+ field_list.push_back(new Item_empty_string("Host", 20));
+ if (opt_show_slave_auth_info)
+ {
+ field_list.push_back(new Item_empty_string("User",20));
+ field_list.push_back(new Item_empty_string("Password",20));
+ }
+ field_list.push_back(new Item_return_int("Port", 7, MYSQL_TYPE_LONG));
+ field_list.push_back(new Item_return_int("Master_id", 10,
+ MYSQL_TYPE_LONG));
+ field_list.push_back(new Item_empty_string("Slave_UUID", UUID_LENGTH));
+
+ if (protocol->send_result_set_metadata(&field_list,
+ Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
+ DBUG_RETURN(TRUE);
+
+ mysql_mutex_lock(&LOCK_slave_list);
+
+ for (uint i = 0; i < slave_list.records; ++i)
+ {
+ SLAVE_INFO* si = (SLAVE_INFO*) my_hash_element(&slave_list, i);
+ protocol->prepare_for_resend();
+ protocol->store((uint32) si->server_id);
+ protocol->store(si->host, &my_charset_bin);
+ if (opt_show_slave_auth_info)
+ {
+ protocol->store(si->user, &my_charset_bin);
+ protocol->store(si->password, &my_charset_bin);
+ }
+ protocol->store((uint32) si->port);
+ protocol->store((uint32) si->master_id);
+
+ /* get slave's UUID */
+ String slave_uuid;
+ if (get_slave_uuid(si->thd, &slave_uuid));
+ protocol->store(slave_uuid.c_ptr_safe(), &my_charset_bin);
+ if (protocol->write())
+ {
+ mysql_mutex_unlock(&LOCK_slave_list);
+ DBUG_RETURN(TRUE);
+ }
+ }
+ mysql_mutex_unlock(&LOCK_slave_list);
+ my_eof(thd);
+ DBUG_RETURN(FALSE);
+}
+
+
/*
fake_rotate_event() builds a fake (=which does not exist physically in any
binlog) Rotate event, which contains the name of the binlog we are going to
=== modified file 'sql/rpl_master.h'
--- a/sql/rpl_master.h 2010-06-22 12:58:10 +0000
+++ b/sql/rpl_master.h 2010-06-24 04:52:52 +0000
@@ -19,18 +19,12 @@
extern bool server_id_supplied;
extern int max_binlog_dump_events;
extern my_bool opt_sporadic_binlog_dump_fail;
-extern my_bool opt_show_slave_auth_info;
-typedef struct st_slave_info
-{
- uint32 server_id;
- uint32 rpl_recovery_rank, master_id;
- char host[HOSTNAME_LENGTH+1];
- char user[USERNAME_LENGTH+1];
- char password[MAX_PASSWORD_LENGTH+1];
- uint16 port;
- THD* thd;
-} SLAVE_INFO;
+void init_slave_list();
+void end_slave_list();
+int register_slave(THD* thd, uchar* packet, uint packet_length);
+void unregister_slave(THD* thd, bool only_mine, bool need_mutex);
+bool show_slave_hosts(THD* thd);
String *get_slave_uuid(THD *thd, String *value);
bool mysql_show_binlog_events(THD* thd);
=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc 2010-06-22 12:58:10 +0000
+++ b/sql/rpl_slave.cc 2010-06-24 04:52:52 +0000
@@ -32,7 +32,6 @@
#include "rpl_mi.h"
#include "rpl_rli.h"
#include "rpl_filter.h"
-#include "repl_failsafe.h"
#include "transaction.h"
#include <thr_alarm.h>
#include <my_dir.h>
@@ -3290,8 +3289,6 @@ err:
/* Forget the relay log's format */
delete mi->rli.relay_log.description_event_for_queue;
mi->rli.relay_log.description_event_for_queue= 0;
- // TODO: make rpl_status part of Master_info
- change_rpl_status(RPL_ACTIVE_SLAVE,RPL_IDLE_SLAVE);
DBUG_ASSERT(thd->net.buff != 0);
net_end(&thd->net); // destructor will not free it, because net.vio is 0
close_thread_tables(thd);
@@ -4479,8 +4476,6 @@ static int connect_to_master(THD* thd, M
if (++err_count == master_retry_count)
{
slave_was_killed=1;
- if (reconnect)
- change_rpl_status(RPL_ACTIVE_SLAVE,RPL_LOST_SOLDIER);
break;
}
safe_sleep(thd,mi->connect_retry,(CHECK_KILLED_FUNC)io_slave_killed,
@@ -4501,7 +4496,6 @@ replication resumed in log '%s' at posit
}
else
{
- change_rpl_status(RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE);
general_log_print(thd, COM_CONNECT_OUT, "%s@%s:%d",
mi->user, mi->host, mi->port);
}
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2010-06-22 12:58:10 +0000
+++ b/sql/sql_parse.cc 2010-06-24 04:52:52 +0000
@@ -79,7 +79,6 @@
#include "rpl_slave.h"
#include "rpl_master.h"
#include "rpl_filter.h"
-#include "repl_failsafe.h"
#include <m_ctype.h>
#include <myisam.h>
#include <my_dir.h>
@@ -2425,14 +2424,9 @@ case SQLCOM_PREPARE:
{
if (check_global_access(thd, REPL_SLAVE_ACL))
goto error;
- /* This query don't work now. See comment in repl_failsafe.cc */
-#ifndef WORKING_NEW_MASTER
+ /* This query don't work now.*/
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "SHOW NEW MASTER");
goto error;
-#else
- res = show_new_master(thd);
- break;
-#endif
}
#ifdef HAVE_REPLICATION
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2010-06-19 07:50:33 +0000
+++ b/sql/sql_show.cc 2010-06-24 04:52:52 +0000
@@ -27,7 +27,6 @@
#include "sql_table.h" // filename_to_tablename,
// primary_key_name,
// build_table_filename
-#include "repl_failsafe.h"
#include "sql_view.h" // mysql_frm_type
#include "sql_parse.h" // check_access, check_table_access
#include "sql_partition.h" // partition_element
=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc 2010-06-22 12:58:10 +0000
+++ b/sql/sys_vars.cc 2010-06-24 04:52:52 +0000
@@ -1517,13 +1517,6 @@ static Sys_var_ulong Sys_div_precincreme
SESSION_VAR(div_precincrement), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, DECIMAL_MAX_SCALE), DEFAULT(4), BLOCK_SIZE(1));
-static Sys_var_ulong Sys_rpl_recovery_rank(
- "rpl_recovery_rank", "Unused, will be removed",
- GLOBAL_VAR(rpl_recovery_rank), CMD_LINE(REQUIRED_ARG),
- VALID_RANGE(0, ULONG_MAX), DEFAULT(0), BLOCK_SIZE(1),
- NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0),
- DEPRECATED(70000, 0));
-
static Sys_var_ulong Sys_range_alloc_block_size(
"range_alloc_block_size",
"Allocation block size for storing ranges during optimization",
Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20100624045252-jzshrwukcc7qqhcs.bundle