List:Commits« Previous MessageNext Message »
From:Luis Soares Date:April 19 2010 9:34pm
Subject:bzr commit into mysql-5.1-rep+2 branch (luis.soares:3183) Bug#44209
View as plain text  
#At file:///home/lsoares/Workspace/bzr/work/features/b44209/mysql-5.1-rep%2B2/ based on revid:zhenxing.he@stripped

 3183 Luis Soares	2010-04-19
      BUG#44209: MASTER_CONNECT_RETRY and --master-retry-count disconnected 
      from each other
        
      MASTER_CONNECT_RETRY and --master-retry-count are logically
      related. The former sets the value for the time the slave thread
      waits until reconnecting, while the latter sets the value for 
      the number of reconnection attempts until it gives up. 
        
      The problem here was that --master-retry-count is not dynamic
      and can only be set on slave startup, while MASTER_CONNECT_RETRY
      is dynamic and can be set using CHANGE MASTER. As such, the user
      should also be allowed to change the value of master_retry_count
      using CHANGE MASTER command.
        
      In this patch we extend the syntax of CHANGE MASTER to allow 
      MASTER_RETRY_COUNT symbol that can be used to set the variable
      that holds the value for master_retry_count. The option 
      --master-retry-count can now be deprecated (this patch takes no
      action regarding deprecating this option).
     @ mysql-test/suite/rpl/t/rpl_change_master.test
        Added test case for new change master option.
     @ sql/lex.h
        Added MASTER_RETRY_COUNT symbol.
     @ sql/rpl_mi.cc
        Added new retry_count Master_info member initialization.
        Retry_count is also persisted/loaded back in/from master.info.
     @ sql/rpl_mi.h
        Added retry_count Master_info member.
     @ sql/slave.cc
        Replaced occurrences of master_retry_count with mi->retry_count.
        Added output for mi->retry_count in SHOW SLAVE STATUS. This is
        actually BUG 44486 proposed patch with mi->retry_count instead
        of master_retry_count.
        Added init_longvar_from_file used while initing the new 
        retry_count mi member variable.
     @ sql/sql_lex.h
        Added retry_count member to lex_mi.
     @ sql/sql_repl.cc
        Added assignement to mi->retry_count to lex_mi->retry_count.
     @ sql/sql_yacc.yy
        Extended the grammar of CHANGE MASTER to cope with the new 
        MASTER_RETRY_COUNT command.

    modified:
      mysql-test/suite/rpl/r/rpl_000015.result
      mysql-test/suite/rpl/r/rpl_bug33931.result
      mysql-test/suite/rpl/r/rpl_change_master.result
      mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
      mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
      mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
      mysql-test/suite/rpl/r/rpl_flushlog_loop.result
      mysql-test/suite/rpl/r/rpl_grant.result
      mysql-test/suite/rpl/r/rpl_heartbeat.result
      mysql-test/suite/rpl/r/rpl_incident.result
      mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
      mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
      mysql-test/suite/rpl/r/rpl_log_pos.result
      mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
      mysql-test/suite/rpl/r/rpl_replicate_do.result
      mysql-test/suite/rpl/r/rpl_rotate_logs.result
      mysql-test/suite/rpl/r/rpl_row_colSize.result
      mysql-test/suite/rpl/r/rpl_row_log.result
      mysql-test/suite/rpl/r/rpl_row_log_innodb.result
      mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
      mysql-test/suite/rpl/r/rpl_row_reset_slave.result
      mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
      mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
      mysql-test/suite/rpl/r/rpl_row_until.result
      mysql-test/suite/rpl/r/rpl_skip_error.result
      mysql-test/suite/rpl/r/rpl_slave_skip.result
      mysql-test/suite/rpl/r/rpl_ssl.result
      mysql-test/suite/rpl/r/rpl_ssl1.result
      mysql-test/suite/rpl/r/rpl_stm_log.result
      mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
      mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
      mysql-test/suite/rpl/r/rpl_stm_until.result
      mysql-test/suite/rpl/r/rpl_temporary_errors.result
      mysql-test/suite/rpl/t/rpl_change_master.test
      mysql-test/suite/rpl/t/rpl_flushlog_loop.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
      sql/lex.h
      sql/rpl_mi.cc
      sql/rpl_mi.h
      sql/slave.cc
      sql/sql_lex.h
      sql/sql_repl.cc
      sql/sql_yacc.yy
=== modified file 'mysql-test/suite/rpl/r/rpl_000015.result'
--- a/mysql-test/suite/rpl/r/rpl_000015.result	2009-11-04 12:28:20 +0000
+++ b/mysql-test/suite/rpl/r/rpl_000015.result	2010-04-19 21:34:43 +0000
@@ -47,6 +47,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	0
+Master_Retry_Count	10
 start slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -89,6 +90,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 drop table if exists t1;
 create table t1 (n int, PRIMARY KEY(n));
 insert into t1 values (10),(45),(90);

=== modified file 'mysql-test/suite/rpl/r/rpl_bug33931.result'
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result	2009-11-28 14:53:48 +0000
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result	2010-04-19 21:34:43 +0000
@@ -44,4 +44,5 @@ Last_SQL_Errno	#
 Last_SQL_Error	Failed during slave thread initialization
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	0
+Master_Retry_Count	10
 SET GLOBAL debug="";

=== modified file 'mysql-test/suite/rpl/r/rpl_change_master.result'
--- a/mysql-test/suite/rpl/r/rpl_change_master.result	2009-10-02 08:35:03 +0000
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result	2010-04-19 21:34:43 +0000
@@ -52,6 +52,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 change master to master_user='root';
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -94,6 +95,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 start slave;
 select * from t1;
 n
@@ -117,3 +119,38 @@ start slave sql_thread;
 start slave io_thread;
 set global relay_log_purge=1;
 drop table t1;
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+Master_Retry_Count: 
+include/stop_slave.inc
+CHANGE MASTER TO master_retry_count=20;
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_retry_count=0;
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_retry_count=1;
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_retry_count=10;
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_retry_count=1;
+### stop slave server
+### start slave server
+include/start_slave.inc
+include/stop_slave.inc
+CHANGE MASTER TO master_retry_count=3, master_host='dummy', master_connect_retry=1;
+START SLAVE io_thread;
+CHANGE MASTER TO master_retry_count='a';
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''a'' at line 1
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;

=== modified file 'mysql-test/suite/rpl/r/rpl_deadlock_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result	2010-04-19 21:34:43 +0000
@@ -91,6 +91,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 
 *** Test lock wait timeout ***
 include/stop_slave.inc
@@ -155,6 +156,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 
 *** Test lock wait timeout and purged relay logs ***
 SET @my_max_relay_log_size= @@global.max_relay_log_size;
@@ -224,6 +226,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 
 *** Clean up ***
 DROP TABLE t1,t2,t3;

=== modified file 'mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2009-12-17 21:43:35 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2010-04-19 21:34:43 +0000
@@ -134,6 +134,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 
 
 ***** Testing Altering table def scenario *****
@@ -512,6 +513,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 
 ****************************************
 * columns in master at middle of table *
@@ -588,6 +590,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -665,6 +668,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -818,6 +822,7 @@ Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 STOP SLAVE;
 RESET SLAVE;
 
@@ -906,6 +911,7 @@ Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 STOP SLAVE;
 RESET SLAVE;
 
@@ -994,6 +1000,7 @@ Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 STOP SLAVE;
 RESET SLAVE;
 

=== modified file 'mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2009-12-17 21:43:35 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2010-04-19 21:34:43 +0000
@@ -134,6 +134,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 
 
 ***** Testing Altering table def scenario *****
@@ -512,6 +513,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 
 ****************************************
 * columns in master at middle of table *
@@ -588,6 +590,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -665,6 +668,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -818,6 +822,7 @@ Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 STOP SLAVE;
 RESET SLAVE;
 
@@ -906,6 +911,7 @@ Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 STOP SLAVE;
 RESET SLAVE;
 
@@ -994,6 +1000,7 @@ Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 STOP SLAVE;
 RESET SLAVE;
 

=== modified file 'mysql-test/suite/rpl/r/rpl_flushlog_loop.result'
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result	2009-10-01 17:22:44 +0000
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result	2010-04-19 21:34:43 +0000
@@ -62,3 +62,4 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	2
+Master_Retry_Count	#

=== modified file 'mysql-test/suite/rpl/r/rpl_grant.result'
--- a/mysql-test/suite/rpl/r/rpl_grant.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_grant.result	2010-04-19 21:34:43 +0000
@@ -82,3 +82,4 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10

=== modified file 'mysql-test/suite/rpl/r/rpl_heartbeat.result'
--- a/mysql-test/suite/rpl/r/rpl_heartbeat.result	2009-11-04 12:28:20 +0000
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result	2010-04-19 21:34:43 +0000
@@ -93,6 +93,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
@@ -134,6 +135,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 show status like 'Slave_heartbeat_period';;
 Variable_name	Slave_heartbeat_period
 Value	0.500

=== modified file 'mysql-test/suite/rpl/r/rpl_incident.result'
--- a/mysql-test/suite/rpl/r/rpl_incident.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_incident.result	2010-04-19 21:34:43 +0000
@@ -66,6 +66,7 @@ Last_SQL_Errno	1590
 Last_SQL_Error	The incident LOST_EVENTS occured on the master. Message: <none>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 SELECT * FROM t1;
@@ -115,4 +116,5 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_known_bugs_detection.result'
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result	2009-11-03 19:02:56 +0000
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result	2010-04-19 21:34:43 +0000
@@ -52,6 +52,7 @@ Last_SQL_Errno	1105
 Last_SQL_Error	Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT * FROM t1;
 a	b
 stop slave;
@@ -145,6 +146,7 @@ ON DUPLICATE KEY UPDATE
 t1.field_3 = t2.field_c'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT * FROM t1;
 id	field_1	field_2	field_3
 drop table t1, t2;

=== modified file 'mysql-test/suite/rpl/r/rpl_loaddata_fatal.result'
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result	2010-02-12 23:30:44 +0000
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result	2010-04-19 21:34:43 +0000
@@ -47,6 +47,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -89,6 +90,7 @@ Last_SQL_Errno	1593
 Last_SQL_Error	Fatal error: Not enough memory
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_log_pos.result'
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result	2009-11-10 18:45:15 +0000
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result	2010-04-19 21:34:43 +0000
@@ -51,6 +51,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 start slave;
 include/stop_slave.inc
 SHOW SLAVE STATUS;
@@ -94,6 +95,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
 master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>

=== modified file 'mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result'
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result	2009-11-03 19:02:56 +0000
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result	2010-04-19 21:34:43 +0000
@@ -61,6 +61,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SHOW BINLOG EVENTS;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 slave-bin.000001	#	Format_desc	2	#	Server ver: VERSION, Binlog ver: 4

=== modified file 'mysql-test/suite/rpl/r/rpl_replicate_do.result'
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result	2010-04-19 21:34:43 +0000
@@ -67,6 +67,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 create table t1 (ts timestamp);
 set one_shot time_zone='met';
 insert into t1 values('2005-08-12 00:00:00');

=== modified file 'mysql-test/suite/rpl/r/rpl_rotate_logs.result'
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2009-11-03 19:02:56 +0000
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2010-04-19 21:34:43 +0000
@@ -55,6 +55,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 select * from t1;
 s
 Could not break slave
@@ -136,6 +137,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 select * from t2;
 m
 34
@@ -205,6 +207,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 lock tables t3 read;
 select count(*) from t3 where n >= 4;
 count(*)

=== modified file 'mysql-test/suite/rpl/r/rpl_row_colSize.result'
--- a/mysql-test/suite/rpl/r/rpl_row_colSize.result	2009-12-17 21:43:35 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result	2010-04-19 21:34:43 +0000
@@ -59,6 +59,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -115,6 +116,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -171,6 +173,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -228,6 +231,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -285,6 +289,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -341,6 +346,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -398,6 +404,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -455,6 +462,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -543,6 +551,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -600,6 +609,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -656,6 +666,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -712,6 +723,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -769,6 +781,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0

=== modified file 'mysql-test/suite/rpl/r/rpl_row_log.result'
--- a/mysql-test/suite/rpl/r/rpl_row_log.result	2009-11-03 19:02:56 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result	2010-04-19 21:34:43 +0000
@@ -288,6 +288,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_log_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result	2009-11-03 19:02:56 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result	2010-04-19 21:34:43 +0000
@@ -288,6 +288,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_max_relay_size.result'
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result	2010-04-19 21:34:43 +0000
@@ -62,6 +62,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 2
 #
@@ -112,6 +113,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 3: max_relay_log_size = 0
 #
@@ -162,6 +164,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
 #
@@ -209,6 +212,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 5
 #
@@ -257,6 +261,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
 #
@@ -303,6 +308,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 flush logs;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB

=== modified file 'mysql-test/suite/rpl/r/rpl_row_reset_slave.result'
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result	2009-11-04 12:28:20 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result	2010-04-19 21:34:43 +0000
@@ -45,6 +45,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 stop slave;
 change master to master_user='test';
 SHOW SLAVE STATUS;
@@ -88,6 +89,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 reset slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -130,6 +132,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 change master to master_user='root';
 start slave;
 SHOW SLAVE STATUS;
@@ -173,6 +176,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 stop slave;
 reset slave;
 start slave;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result	2009-12-17 21:43:35 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result	2010-04-19 21:34:43 +0000
@@ -159,6 +159,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 INSERT INTO t9 VALUES (4);
 INSERT INTO t4 VALUES (4);
 SHOW SLAVE STATUS;
@@ -202,6 +203,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (5);
@@ -247,6 +249,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -292,6 +295,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -336,6 +340,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 INSERT INTO t7 VALUES (1),(2),(3);
 INSERT INTO t8 VALUES (1),(2),(3);
 SELECT * FROM t7 ORDER BY a;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result	2009-12-17 21:43:35 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result	2010-04-19 21:34:43 +0000
@@ -159,6 +159,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 INSERT INTO t9 VALUES (4);
 INSERT INTO t4 VALUES (4);
 SHOW SLAVE STATUS;
@@ -202,6 +203,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (5);
@@ -247,6 +249,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -292,6 +295,7 @@ Last_SQL_Errno	1658
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -336,6 +340,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 INSERT INTO t7 VALUES (1),(2),(3);
 INSERT INTO t8 VALUES (1),(2),(3);
 SELECT * FROM t7 ORDER BY a;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_until.result'
--- a/mysql-test/suite/rpl/r/rpl_row_until.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result	2010-04-19 21:34:43 +0000
@@ -61,6 +61,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
 SELECT * FROM t1;
 n
@@ -109,6 +110,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2
 SELECT * FROM t2;
 n
@@ -155,6 +157,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 START SLAVE;
 include/stop_slave.inc
 START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2
@@ -199,6 +202,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561;
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
 START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12;

=== modified file 'mysql-test/suite/rpl/r/rpl_skip_error.result'
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result	2010-04-19 21:34:43 +0000
@@ -72,6 +72,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 ==== Clean Up ====
 drop table t1;
 create table t1(a int primary key);
@@ -127,6 +128,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 ==== Clean Up ====
 drop table t1;
 ==== Using Innodb ====

=== modified file 'mysql-test/suite/rpl/r/rpl_slave_skip.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result	2010-01-15 17:52:46 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result	2010-04-19 21:34:43 +0000
@@ -84,6 +84,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 SELECT * FROM t1;
@@ -152,6 +153,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 **** On Master ****
 DROP TABLE t1, t2;
 SET SESSION BINLOG_FORMAT=ROW;

=== modified file 'mysql-test/suite/rpl/r/rpl_ssl.result'
--- a/mysql-test/suite/rpl/r/rpl_ssl.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result	2010-04-19 21:34:43 +0000
@@ -60,6 +60,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 STOP SLAVE;
 select * from t1;
 t
@@ -106,6 +107,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 drop user replssl@localhost;
 drop table t1;
 End of 5.0 tests

=== modified file 'mysql-test/suite/rpl/r/rpl_ssl1.result'
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result	2010-04-19 21:34:43 +0000
@@ -59,6 +59,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 stop slave;
 change master to master_user='root',master_password='', master_ssl=0;
 start slave;
@@ -105,6 +106,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 stop slave;
 change master to
 master_host="localhost",
@@ -161,4 +163,5 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 drop table t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_log.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result	2010-02-12 23:30:44 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result	2010-04-19 21:34:43 +0000
@@ -286,6 +286,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result	2010-04-19 21:34:43 +0000
@@ -62,6 +62,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 2
 #
@@ -112,6 +113,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 3: max_relay_log_size = 0
 #
@@ -162,6 +164,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
 #
@@ -209,6 +212,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 5
 #
@@ -257,6 +261,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 #
 # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
 #
@@ -303,6 +308,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 flush logs;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_reset_slave.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result	2009-11-04 12:28:20 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result	2010-04-19 21:34:43 +0000
@@ -45,6 +45,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 stop slave;
 change master to master_user='test';
 SHOW SLAVE STATUS;
@@ -88,6 +89,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 reset slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -130,6 +132,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 change master to master_user='root';
 start slave;
 SHOW SLAVE STATUS;
@@ -173,6 +176,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 stop slave;
 reset slave;
 start slave;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_until.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result	2010-02-12 23:30:44 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result	2010-04-19 21:34:43 +0000
@@ -65,6 +65,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
 select * from t1;
 n
@@ -113,6 +114,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=891;
 select * from t2;
 n
@@ -159,6 +161,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 start slave;
 [on master]
 [on slave]
@@ -205,6 +208,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 ==== Test various error conditions ====
 start slave until master_log_file='master-bin', master_log_pos=561;
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL

=== modified file 'mysql-test/suite/rpl/r/rpl_temporary_errors.result'
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result	2009-10-18 03:57:38 +0000
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result	2010-04-19 21:34:43 +0000
@@ -80,6 +80,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 DROP TABLE t1;
 **** On Master ****
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/t/rpl_change_master.test'
--- a/mysql-test/suite/rpl/t/rpl_change_master.test	2009-11-27 23:34:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_change_master.test	2010-04-19 21:34:43 +0000
@@ -84,3 +84,129 @@ eval set global relay_log_purge=$relay_l
 connection master;
 drop table t1;
 sync_slave_with_master;
+
+#
+# BUG#44209: MASTER_CONNECT_RETRY and --master-retry-count disconnected from each other
+#
+
+-- connection master
+-- source include/master-slave-reset.inc
+
+-- connection slave
+-- let $retry_count0= query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1)
+
+# assertion: show that the command line is still valid (MTR sets it to 10)
+-- echo Master_Retry_Count: $retry_count
+
+-- source include/stop_slave.inc
+
+# action: change the initial value to some other value
+-- let $retry_count1= `SELECT $retry_count0+10`
+-- eval CHANGE MASTER TO master_retry_count=$retry_count1
+
+-- source include/start_slave.inc
+
+-- let $retry_count1= query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1)
+# assertion: it shows the new value -- retry_count0 +10
+if (`SELECT $retry_count1 <> ($retry_count0+10)`)
+{
+  -- let $expected= `SELECT $retry_count0+10`
+  -- echo Unexpected retry count value! Got: $retry_count1, expected: $expected
+  -- die
+}
+
+-- source include/stop_slave.inc
+
+# action: change master_retry_count to zero, which should produce no change.
+CHANGE MASTER TO master_retry_count=0;
+
+-- source include/start_slave.inc
+
+-- let $retry_count2= query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1)
+# assertion: it shows no changes
+if (`SELECT $retry_count2 <> $retry_count1`)
+{
+  -- echo Unexpected retry count value! Got: $retry_count2, expected: $retry_count1
+  -- die
+}
+
+-- source include/stop_slave.inc
+
+# action: change the value to the smallest value possible
+CHANGE MASTER TO master_retry_count=1;
+
+-- source include/start_slave.inc
+
+-- let $retry_count3= query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1)
+# assertion: it should show 1
+if (`SELECT $retry_count3 <> 1`)
+{
+  -- echo Unexpected retry count value! Got: $retry_count3, expected: 1
+  -- die
+}
+
+-- source include/stop_slave.inc
+
+# action: change the value back to the original one
+-- eval CHANGE MASTER TO master_retry_count=$retry_count0
+
+-- source include/start_slave.inc
+
+-- let $retry_count4= query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1)
+# assertion: it should show 1
+if (`SELECT $retry_count4 <> $retry_count0`)
+{
+  -- echo Unexpected retry count value! Got: $retry_count4, expected: $retry_count0
+  -- die
+}
+
+## Now lets change master_retry_count to 1 and stop and restart the slave 
+## to check whether master_retry_count persists or not
+-- source include/stop_slave.inc
+-- let $retry_count_expected= 1
+-- eval CHANGE MASTER TO master_retry_count=$retry_count_expected
+
+# Stop master server
+--echo ### stop slave server
+--write_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+wait
+EOF
+--shutdown_server 10
+--source include/wait_until_disconnected.inc
+  
+--echo ### start slave server
+--append_file $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
+restart
+EOF
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+-- connection slave
+-- source include/start_slave.inc
+
+-- let $retry_count5= query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1)
+if (`SELECT $retry_count5 <> $retry_count_expected`)
+{
+  -- echo Unexpected retry count value! Got: $retry_count5, expected: $retry_count_expected
+  -- die
+}
+
+## Checks that the slave actually gives up after retrying N times, where
+## N was set with CHANGE MASTER TO master_retry_count=N
+
+-- source include/stop_slave.inc
+CHANGE MASTER TO master_retry_count=3, master_host='dummy', master_connect_retry=1;
+START SLAVE io_thread;
+
+# limit wait timeout to 4 seconds (should be three, but this is not much deterministic,
+# so we set it to a value higher but close to three - keeping in mind slow machines in
+# test environment). Also, see wait_for_slave_param how slave_timeout is used.
+-- let $slave_timeout= 40
+-- source include/wait_for_slave_io_to_stop.inc
+
+## check that there is a parse error if not using a numerical value
+-- error ER_PARSE_ERROR
+CHANGE MASTER TO master_retry_count='a';
+
+-- source include/master-slave-reset.inc
+-- source include/master-slave-end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_flushlog_loop.test'
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test	2009-11-27 23:34:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test	2010-04-19 21:34:43 +0000
@@ -71,7 +71,7 @@ source include/wait_for_slave_param.inc;
 #  Show status of slave
 #
 --replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION
---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # 41 #
 --query_vertical SHOW SLAVE STATUS
 
 --disable_query_log

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result	2010-04-19 21:34:43 +0000
@@ -181,6 +181,7 @@ Last_SQL_Errno	<Last_SQL_Errno>
 Last_SQL_Error	<Last_SQL_Error>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 set GLOBAL slave_transaction_retries=10;
 include/start_slave.inc
 select * from t1 order by nid;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result	2010-04-19 21:34:43 +0000
@@ -58,6 +58,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
@@ -103,5 +104,6 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	2
+Master_Retry_Count	86400
 STOP SLAVE;
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result	2009-11-10 18:45:15 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result	2010-04-19 21:34:43 +0000
@@ -55,6 +55,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	2
+Master_Retry_Count	86400
 SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
@@ -106,4 +107,5 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_idempotent.result	2010-04-19 21:34:43 +0000
@@ -33,15 +33,15 @@ c1	c2	c3
 row3	C	3
 row4	D	4
 SHOW SLAVE STATUS;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error	Replicate_Ignore_Server_Ids	Master_Server_Id
-<Slave_IO_State>	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	<Read_Master_Log_Pos>	<Relay_Log_File>	<Relay_Log_Pos>	master-bin.000001	Yes	Yes				<Replicate_Ignore_Table>			0		0	<Exec_Master_Log_Pos>	<Relay_Log_Space>	None		0	No						<Seconds_Behind_Master>	No	<Last_IO_Errno>	<Last_IO_Error>	0			1
+Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error	Replicate_Ignore_Server_Ids	Master_Server_Id	Master_Retry_Count
+<Slave_IO_State>	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	<Read_Master_Log_Pos>	<Relay_Log_File>	<Relay_Log_Pos>	master-bin.000001	Yes	Yes				<Replicate_Ignore_Table>			0		0	<Exec_Master_Log_Pos>	<Relay_Log_Space>	None		0	No						<Seconds_Behind_Master>	No	<Last_IO_Errno>	<Last_IO_Error>	0			1	10
 STOP SLAVE;
 CHANGE MASTER TO
 master_log_file = 'master-bin.000001',
 master_log_pos = <the_pos> ;
 SHOW SLAVE STATUS;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error	Replicate_Ignore_Server_Ids	Master_Server_Id
-<Slave_IO_State>	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	<Read_Master_Log_Pos>	<Relay_Log_File>	<Relay_Log_Pos>	master-bin.000001	No	No				<Replicate_Ignore_Table>			0		0	<Exec_Master_Log_Pos>	<Relay_Log_Space>	None		0	No						<Seconds_Behind_Master>	No	<Last_IO_Errno>	<Last_IO_Error>	0			1
+Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error	Replicate_Ignore_Server_Ids	Master_Server_Id	Master_Retry_Count
+<Slave_IO_State>	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	<Read_Master_Log_Pos>	<Relay_Log_File>	<Relay_Log_Pos>	master-bin.000001	No	No				<Replicate_Ignore_Table>			0		0	<Exec_Master_Log_Pos>	<Relay_Log_Space>	None		0	No						<Seconds_Behind_Master>	No	<Last_IO_Errno>	<Last_IO_Error>	0			1	10
 START SLAVE;
 SELECT * FROM t1 ORDER BY c3;
 c1	c2	c3
@@ -68,6 +68,6 @@ SELECT * FROM t1;
 c1	c2	c3
 row2	new on slave	2
 SHOW SLAVE STATUS;
-Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error	Replicate_Ignore_Server_Ids	Master_Server_Id
-<Slave_IO_State>	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	<Read_Master_Log_Pos>	<Relay_Log_File>	<Relay_Log_Pos>	master-bin.000001	Yes	Yes				<Replicate_Ignore_Table>			0		0	<Exec_Master_Log_Pos>	<Relay_Log_Space>	None		0	No						<Seconds_Behind_Master>	<Last_IO_Errno>	<Last_IO_Error>		0			1
+Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master	Master_SSL_Verify_Server_Cert	Last_IO_Errno	Last_IO_Error	Last_SQL_Errno	Last_SQL_Error	Replicate_Ignore_Server_Ids	Master_Server_Id	Master_Retry_Count
+<Slave_IO_State>	127.0.0.1	root	MASTER_PORT	1	master-bin.000001	<Read_Master_Log_Pos>	<Relay_Log_File>	<Relay_Log_Pos>	master-bin.000001	Yes	Yes				<Replicate_Ignore_Table>			0		0	<Exec_Master_Log_Pos>	<Relay_Log_Space>	None		0	No						<Seconds_Behind_Master>	<Last_IO_Errno>	<Last_IO_Error>		0			1	10
 DROP TABLE IF EXISTS t1;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result	2009-11-03 19:02:56 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result	2010-04-19 21:34:43 +0000
@@ -304,6 +304,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2009-10-01 16:44:53 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2010-04-19 21:34:43 +0000
@@ -109,6 +109,7 @@ Last_SQL_Errno	0
 Last_SQL_Error	
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
+Master_Retry_Count	10
 SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
 hex(c1)	hex(c2)	c3
 1	1	row1

=== modified file 'sql/lex.h'
--- a/sql/lex.h	2009-12-03 08:59:58 +0000
+++ b/sql/lex.h	2010-04-19 21:34:43 +0000
@@ -315,6 +315,7 @@ static SYMBOL symbols[] = {
   { "MASTER_LOG_POS",           SYM(MASTER_LOG_POS_SYM)},
   { "MASTER_PASSWORD",           SYM(MASTER_PASSWORD_SYM)},
   { "MASTER_PORT",           SYM(MASTER_PORT_SYM)},
+  { "MASTER_RETRY_COUNT",           SYM(MASTER_RETRY_COUNT_SYM)},
   { "MASTER_SERVER_ID",           SYM(MASTER_SERVER_ID_SYM)},
   { "MASTER_SSL",       SYM(MASTER_SSL_SYM)},
   { "MASTER_SSL_CA",    SYM(MASTER_SSL_CA_SYM)},

=== modified file 'sql/rpl_mi.cc'
--- a/sql/rpl_mi.cc	2009-11-04 12:28:20 +0000
+++ b/sql/rpl_mi.cc	2010-04-19 21:34:43 +0000
@@ -24,6 +24,7 @@
 #define DEFAULT_CONNECT_RETRY 60
 
 // Defined in slave.cc
+int init_longvar_from_file(long* var, IO_CACHE* f, long default_val);
 int init_intvar_from_file(int* var, IO_CACHE* f, int default_val);
 int init_strvar_from_file(char *var, int max_size, IO_CACHE *f,
 			  const char *default_val);
@@ -36,7 +37,8 @@ Master_info::Master_info(bool is_slave_r
    port(MYSQL_PORT), connect_retry(DEFAULT_CONNECT_RETRY), inited(0), 
    rli(is_slave_recovery), abort_slave(0), 
    slave_running(0), slave_run_id(0), sync_counter(0),
-   heartbeat_period(0), received_heartbeats(0), master_id(0)
+   heartbeat_period(0), received_heartbeats(0), master_id(0),
+   retry_count(master_retry_count)
 {
   host[0] = 0; user[0] = 0; password[0] = 0;
   ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;
@@ -132,8 +134,10 @@ enum {
   LINE_FOR_MASTER_HEARTBEAT_PERIOD= 16,
   /* 6.0 added value of master_ignore_server_id */
   LINE_FOR_REPLICATE_IGNORE_SERVER_IDS= 17,
+  /* line for master_retry_count */
+  LINE_FOR_MASTER_RETRY_COUNT= 18,
   /* Number of lines currently used when saving master info file */
-  LINES_IN_MASTER_INFO= LINE_FOR_REPLICATE_IGNORE_SERVER_IDS
+  LINES_IN_MASTER_INFO= LINE_FOR_MASTER_RETRY_COUNT
 };
 
 int init_master_info(Master_info* mi, const char* master_info_fname,
@@ -237,6 +241,7 @@ file '%s')", fname);
     int ssl= 0, ssl_verify_server_cert= 0;
     float master_heartbeat_period= 0.0;
     char *first_non_digit;
+    long retry_count;
 
     /*
        Starting from 4.1.x master.info has new format. Now its
@@ -335,6 +340,14 @@ file '%s')", fname);
         sql_print_error("Failed to initialize master info ignore_server_ids");
         goto errwithmsg;
       }
+
+      /* master_retry_count may be in the file. */
+      if (lines >= LINE_FOR_MASTER_RETRY_COUNT &&
+          init_longvar_from_file(&retry_count, &mi->file, master_retry_count))
+      {
+        sql_print_error("Failed to initialize master info master_retry_count");
+        goto errwithmsg;
+      }
     }
 
 #ifndef HAVE_OPENSSL
@@ -354,6 +367,7 @@ file '%s')", fname);
     mi->ssl= (my_bool) ssl;
     mi->ssl_verify_server_cert= ssl_verify_server_cert;
     mi->heartbeat_period= master_heartbeat_period;
+    mi->retry_count= retry_count;
   }
   DBUG_PRINT("master_info",("log_file_name: %s  position: %ld",
                             mi->master_log_name,
@@ -464,14 +478,14 @@ int flush_master_info(Master_info* mi, b
   my_sprintf(heartbeat_buf, (heartbeat_buf, "%.3f", mi->heartbeat_period));
   my_b_seek(file, 0L);
   my_b_printf(file,
-              "%u\n%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n%s\n%s\n%s\n%s\n%s\n%d\n%s\n%s\n",
+              "%u\n%s\n%s\n%s\n%s\n%s\n%d\n%d\n%d\n%s\n%s\n%s\n%s\n%s\n%d\n%s\n%s\n%ld\n",
               LINES_IN_MASTER_INFO,
               mi->master_log_name, llstr(mi->master_log_pos, lbuf),
               mi->host, mi->user,
               mi->password, mi->port, mi->connect_retry,
               (int)(mi->ssl), mi->ssl_ca, mi->ssl_capath, mi->ssl_cert,
               mi->ssl_cipher, mi->ssl_key, mi->ssl_verify_server_cert,
-              heartbeat_buf, ignore_server_ids_buf);
+              heartbeat_buf, ignore_server_ids_buf, mi->retry_count);
   my_free(ignore_server_ids_buf, MYF(0));
   err= flush_io_cache(file);
   if (sync_masterinfo_period && !err && 

=== modified file 'sql/rpl_mi.h'
--- a/sql/rpl_mi.h	2009-11-04 12:28:20 +0000
+++ b/sql/rpl_mi.h	2010-04-19 21:34:43 +0000
@@ -112,6 +112,7 @@ class Master_info : public Slave_reporti
   ulonglong received_heartbeats;  // counter of received heartbeat events
   DYNAMIC_ARRAY ignore_server_ids;
   ulong master_id;
+  ulong retry_count;
 };
 void init_master_log_pos(Master_info* mi);
 int init_master_info(Master_info* mi, const char* master_info_fname,

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2010-02-12 23:30:44 +0000
+++ b/sql/slave.cc	2010-04-19 21:34:43 +0000
@@ -1000,6 +1000,25 @@ int init_intvar_from_file(int* var, IO_C
   DBUG_RETURN(1);
 }
 
+int init_longvar_from_file(long* var, IO_CACHE* f, long default_val)
+{
+  char buf[32];
+  DBUG_ENTER("init_longvar_from_file");
+
+
+  if (my_b_gets(f, buf, sizeof(buf)))
+  {
+    *var = atol(buf);
+    DBUG_RETURN(0);
+  }
+  else if (default_val)
+  {
+    *var = default_val;
+    DBUG_RETURN(0);
+  }
+  DBUG_RETURN(1);
+}
+
 int init_floatvar_from_file(float* var, IO_CACHE* f, float default_val)
 {
   char buf[16];
@@ -1723,6 +1742,8 @@ bool show_master_info(THD* thd, Master_i
                                              FN_REFLEN));
   field_list.push_back(new Item_return_int("Master_Server_Id", sizeof(ulong),
                                            MYSQL_TYPE_LONG));
+  field_list.push_back(new Item_return_int("Master_Retry_Count", 10,
+                                           MYSQL_TYPE_LONGLONG));
 
   if (protocol->send_fields(&field_list,
                             Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
@@ -1872,6 +1893,9 @@ bool show_master_info(THD* thd, Master_i
     // Master_Server_id
     protocol->store((uint32) mi->master_id);
 
+    // Master_Retry_Count
+    protocol->store((ulonglong) mi->retry_count);
+
     pthread_mutex_unlock(&mi->rli.err_lock);
     pthread_mutex_unlock(&mi->err_lock);
     pthread_mutex_unlock(&mi->rli.data_lock);
@@ -2533,11 +2557,11 @@ static bool check_io_slave_killed(THD *t
   @details Terminates current connection to master, sleeps for
   @c mi->connect_retry msecs and initiates new connection with
   @c safe_reconnect(). Variable pointed by @c retry_count is increased -
-  if it exceeds @c master_retry_count then connection is not re-established
+  if it exceeds @c mi->retry_count then connection is not re-established
   and function signals error.
   Unless @c suppres_warnings is TRUE, a warning is put in the server error log
   when reconnecting. The warning message and messages used to report errors
-  are taken from @c messages array. In case @c master_retry_count is exceeded,
+  are taken from @c messages array. In case @c mi->retry_count is exceeded,
   no messages are added to the log.
 
   @param[in]     thd                 Thread context.
@@ -2565,7 +2589,7 @@ static int try_to_reconnect(THD *thd, MY
   end_server(mysql);
   if ((*retry_count)++)
   {
-    if (*retry_count > master_retry_count)
+    if (*retry_count > mi->retry_count)
       return 1;                             // Don't retry forever
     safe_sleep(thd, mi->connect_retry, (CHECK_KILLED_FUNC) io_slave_killed,
                (void *) mi);
@@ -4039,7 +4063,7 @@ static int safe_connect(THD* thd, MYSQL*
 
   IMPLEMENTATION
     Try to connect until successful or slave killed or we have retried
-    master_retry_count times
+    mi->retry_count times
 */
 
 static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
@@ -4094,15 +4118,15 @@ static int connect_to_master(THD* thd, M
                  " - retry-time: %d  retries: %lu",
                  (reconnect ? "reconnecting" : "connecting"),
                  mi->user, mi->host, mi->port,
-                 mi->connect_retry, master_retry_count);
+                 mi->connect_retry, mi->retry_count);
     }
     /*
       By default we try forever. The reason is that failure will trigger
-      master election, so if the user did not set master_retry_count we
+      master election, so if the user did not set mi->retry_count we
       do not want to have election triggered on the first failure to
       connect
     */
-    if (++err_count == master_retry_count)
+    if (++err_count == mi->retry_count)
     {
       slave_was_killed=1;
       if (reconnect)
@@ -4146,7 +4170,7 @@ replication resumed in log '%s' at posit
 
   IMPLEMENTATION
     Try to connect until successful or slave killed or we have retried
-    master_retry_count times
+    mi->retry_count times
 */
 
 static int safe_reconnect(THD* thd, MYSQL* mysql, Master_info* mi,

=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h	2010-03-03 14:43:35 +0000
+++ b/sql/sql_lex.h	2010-04-19 21:34:43 +0000
@@ -208,7 +208,7 @@ typedef struct st_lex_master_info
   uint port, connect_retry;
   float heartbeat_period;
   ulonglong pos;
-  ulong server_id;
+  ulong server_id, retry_count;
   /*
     Enum is used for making it possible to detect if the user
     changed variable or if it should be left at old value

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2010-03-03 14:43:35 +0000
+++ b/sql/sql_repl.cc	2010-04-19 21:34:43 +0000
@@ -1404,6 +1404,8 @@ bool change_master(THD* thd, Master_info
     mi->port = lex_mi->port;
   if (lex_mi->connect_retry)
     mi->connect_retry = lex_mi->connect_retry;
+  if (lex_mi->retry_count)
+    mi->retry_count = lex_mi->retry_count;
   if (lex_mi->heartbeat_opt != LEX_MASTER_INFO::LEX_MI_UNCHANGED)
     mi->heartbeat_period = lex_mi->heartbeat_period;
   else

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2010-03-03 14:43:35 +0000
+++ b/sql/sql_yacc.yy	2010-04-19 21:34:43 +0000
@@ -967,6 +967,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  MASTER_LOG_POS_SYM
 %token  MASTER_PASSWORD_SYM
 %token  MASTER_PORT_SYM
+%token  MASTER_RETRY_COUNT_SYM
 %token  MASTER_SERVER_ID_SYM
 %token  MASTER_SSL_CAPATH_SYM
 %token  MASTER_SSL_CA_SYM
@@ -1763,6 +1764,10 @@ master_def:
           {
             Lex->mi.connect_retry = $3;
           }
+        | MASTER_RETRY_COUNT_SYM EQ ulong_num
+          {
+            Lex->mi.retry_count = $3;
+          }
         | MASTER_SSL_SYM EQ ulong_num
           {
             Lex->mi.ssl= $3 ? 
@@ -11726,6 +11731,7 @@ keyword_sp:
         | MASTER_PASSWORD_SYM      {}
         | MASTER_SERVER_ID_SYM     {}
         | MASTER_CONNECT_RETRY_SYM {}
+        | MASTER_RETRY_COUNT_SYM   {}
         | MASTER_SSL_SYM           {}
         | MASTER_SSL_CA_SYM        {}
         | MASTER_SSL_CAPATH_SYM    {}


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20100419213443-o188fyir2xeynicz.bundle
Thread
bzr commit into mysql-5.1-rep+2 branch (luis.soares:3183) Bug#44209Luis Soares19 Apr