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

 3183 Luis Soares	2010-04-21
      BUG#43535: last_io_error in show slave status is confusing
            
      Although IO and SQL thread errors numbers and messages are reported in
      SHOW SLAVE STATUS output, the correspondent timestamp at which they
      have occurred is not. As such the user may be left wondering whenever
      the error happened (NOTE: actually, in the error log, a timestamp
      should be printed along with the error message, however in SHOW SLAVE
      STATUS it is not currently).
            
      Furthermore, at the time this bug was reported, there was no way for
      the user to clean the error number and message reported.
            
      This patch adds a timestamp, similar to the one found in the error
      log, to the Last_*_Error columns. It appends it at the beginning of
      the error message, as in (square brackes not included):
      
       "Last_IO_Error    YYMMDD hh:mm:ss [PLAIN OLD ERROR MESSAGE ...]"
           
      The computation of the timestamp is added as a new method of the Error
      class (update_timestamp), which in turn is an inner class of the
      Slave_reporting_capability. This new method is called everytime
      Slave_reporting_capability::report is invoked with log level set to
      ERROR_LEVEL, thence capturing the timestamp of the error being
      reported.
            
      Starting from 5.1.37 (ie, when the fix for BUG 44270 was released),
      the fields are cleared on RESET SLAVE. Furthermore, the test case
      added in this patch checks that: (1) the error message(s) is not reset
      on explicit stop slave after an error occurred; (2) the error
      message(s) is reset when slave recovers from the error (ie, when the
      DBA fixes the problem and resumes replication by issuing START
      SLAVE). Moreover, clearing the new Timestamp fields is done in the
      Error class clear() method, therefore when Last_*_Errno and
      Last_*_Error are reset, Last_*_Error_Timestamp is gets reset also.
            
      Finally, this patch accommodates the changes needed for existing MTR
      server tests:
            
       - result files are updated due to the new _Timestamp columns
            
       - show_slave_status.inc include files are augmented with
         replace_regex to mask out the timestamp from result files
            
       - some tests are also changed to mask out the output for the
         new _Timestamp columns
     @ mysql-test/suite/rpl/t/rpl_show_errors.test
        Test case added for checking the timestamp on error messages from 
        SHOW SLAVE STATUS command.
     @ sql/rpl_reporting.cc
        Deployed call to update_timestamp() method whenever an error
        is reported.
     @ sql/rpl_reporting.h
        Adds timestamp field to the Error class.
        Adds cleaning the timestamp field to the clear() method.
        Adds update_timestamp method (calculates a timestamp and 
        sets it to the newly added timestamp field).
     @ sql/slave.cc
        Appends last_error().timestamp to the beginning of the output for 
        Last_IO/SQL_Error in SHOW SLAVE STATUS.

    added:
      mysql-test/suite/rpl/r/rpl_show_errors.result
      mysql-test/suite/rpl/t/rpl_show_errors.test
    modified:
      mysql-test/extra/rpl_tests/rpl_conflicts.test
      mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
      mysql-test/extra/rpl_tests/rpl_row_basic.test
      mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test
      mysql-test/extra/rpl_tests/rpl_stop_middle_group.test
      mysql-test/include/show_slave_status.inc
      mysql-test/include/show_slave_status2.inc
      mysql-test/include/test_fieldsize.inc
      mysql-test/include/wait_for_slave_sql_error_and_skip.inc
      mysql-test/suite/rpl/r/rpl_bug33931.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_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_row_colSize.result
      mysql-test/suite/rpl/t/rpl_binlog_corruption.test
      mysql-test/suite/rpl/t/rpl_bug33931.test
      mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
      mysql-test/suite/rpl/t/rpl_incident.test
      mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
      mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
      mysql-test/suite/rpl/t/rpl_packet.test
      mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
      mysql-test/suite/rpl/t/rpl_server_id1.test
      sql/rpl_reporting.cc
      sql/rpl_reporting.h
      sql/slave.cc
=== modified file 'mysql-test/extra/rpl_tests/rpl_conflicts.test'
--- a/mysql-test/extra/rpl_tests/rpl_conflicts.test	2009-01-09 14:12:31 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test	2010-04-21 17:22:00 +0000
@@ -92,6 +92,7 @@ if (`SELECT @@global.binlog_format != 'R
   let $slave_sql_errno= 1062; # ER_DUP_ENTRY
   source include/wait_for_slave_sql_error.inc;
   let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+  let $err= `SELECT SUBSTRING("$err" FROM 17)`;
   --echo Last_SQL_Error = $err (expected "duplicate key" error)
   SELECT * FROM t1;
 
@@ -104,6 +105,7 @@ if (`SELECT @@global.binlog_format != 'R
 --echo ---- Sync slave and verify that there is no error ----
 sync_with_master;
 let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $err= `SELECT SUBSTRING("$err" FROM 17)`;
 --echo Last_SQL_Error = '$err' (expected no error)
 SELECT * FROM t1;
 
@@ -140,6 +142,7 @@ if (`SELECT @@global.binlog_format = 'RO
   let $slave_sql_errno= 1032; # ER_KEY_NOT_FOUND
   source include/wait_for_slave_sql_error.inc;
   let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+  let $err= `SELECT SUBSTRING("$err" FROM 17)`;
   --echo Last_SQL_Error = $err (expected "can't find record" error)
   SELECT * FROM t1;
 
@@ -154,6 +157,7 @@ if (`SELECT @@global.binlog_format = 'RO
 # error.
 sync_with_master;
 let $err= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $err= `SELECT SUBSTRING("$err" FROM 17)`;
 --echo Last_SQL_Error = $err (expected no error)
 SELECT * FROM t1;
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2009-02-05 09:49:32 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2010-04-21 17:22:00 +0000
@@ -500,6 +500,7 @@ connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
@@ -557,6 +558,7 @@ connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
@@ -700,6 +702,7 @@ connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 #***************************
 
@@ -766,6 +769,7 @@ connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 STOP SLAVE;
 RESET SLAVE;
@@ -843,6 +847,7 @@ connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 STOP SLAVE;
 RESET SLAVE;

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_basic.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test	2009-12-14 11:04:55 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test	2010-04-21 17:22:00 +0000
@@ -271,6 +271,7 @@ query_vertical SELECT COUNT(*) FROM t1 O
 sync_slave_with_master;
 set @@global.slave_exec_mode= default;
 let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $last_error= `SELECT SUBSTRING("$last_error" FROM 17)`;
 disable_query_log;
 eval SELECT "$last_error" AS Last_SQL_Error;
 enable_query_log;
@@ -414,6 +415,7 @@ INSERT INTO t5 VALUES (2, repeat(_utf8'a
 connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $last_error= `SELECT SUBSTRING("$last_error" FROM 17)`;
 disable_query_log;
 eval SELECT "$last_error" AS Last_SQL_Error;
 enable_query_log;
@@ -433,6 +435,7 @@ INSERT INTO t6 VALUES (2, repeat(_utf8'a
 connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+let $last_error= `SELECT SUBSTRING("$last_error" FROM 17)`;
 disable_query_log;
 eval SELECT "$last_error" AS Last_SQL_Error;
 enable_query_log;

=== modified file 'mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test'
--- a/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test	2008-11-13 19:19:00 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test	2010-04-21 17:22:00 +0000
@@ -27,6 +27,7 @@ connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
 let $errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
+let $error= `SELECT SUBSTRING("$error" FROM 17)`;
 --echo Error: "$error" (expected different error codes on master and slave)
 --echo Errno: "$errno" (expected 0)
 drop table t1;

=== modified file 'mysql-test/extra/rpl_tests/rpl_stop_middle_group.test'
--- a/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test	2009-11-03 19:02:56 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test	2010-04-21 17:22:00 +0000
@@ -36,6 +36,7 @@ let $read = query_get_value("SHOW SLAVE 
 let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
 --disable_query_log
 eval SELECT $read = $exec into @check;
+let $error= `SELECT SUBSTRING("$error" FROM 17)`;
 --enable_query_log
 eval SELECT "NO$error" AS Last_SQL_Error, @check as `true`;
 select count(*) as one from tm;
@@ -89,6 +90,7 @@ let $read = query_get_value("SHOW SLAVE 
 let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
 --disable_query_log
 eval SELECT $read - $exec > 0 into @check;
+let $error= `SELECT SUBSTRING("$error" FROM 17)`;
 --enable_query_log
 eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
 select count(*) as one  from tm;
@@ -128,6 +130,7 @@ let $read = query_get_value("SHOW SLAVE 
 let $exec = query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1);
 --disable_query_log
 eval SELECT $read - $exec > 0 into @check;
+let $error= `SELECT SUBSTRING("$error" FROM 17)`;
 --enable_query_log
 eval SELECT "$error" AS Last_SQL_Error, @check as `true`;
 select max(a) as two from tm;

=== modified file 'mysql-test/include/show_slave_status.inc'
--- a/mysql-test/include/show_slave_status.inc	2007-06-11 20:15:39 +0000
+++ b/mysql-test/include/show_slave_status.inc	2010-04-21 17:22:00 +0000
@@ -3,4 +3,5 @@
 
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 query_vertical SHOW SLAVE STATUS;

=== modified file 'mysql-test/include/show_slave_status2.inc'
--- a/mysql-test/include/show_slave_status2.inc	2008-01-14 07:38:02 +0000
+++ b/mysql-test/include/show_slave_status2.inc	2010-04-21 17:22:00 +0000
@@ -5,4 +5,5 @@
 
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 query_vertical SHOW SLAVE STATUS;

=== modified file 'mysql-test/include/test_fieldsize.inc'
--- a/mysql-test/include/test_fieldsize.inc	2009-09-29 14:10:37 +0000
+++ b/mysql-test/include/test_fieldsize.inc	2010-04-21 17:22:00 +0000
@@ -25,6 +25,7 @@ START SLAVE;
 --source include/wait_for_slave_sql_to_stop.inc
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 
 # The following should be 0

=== modified file 'mysql-test/include/wait_for_slave_sql_error_and_skip.inc'
--- a/mysql-test/include/wait_for_slave_sql_error_and_skip.inc	2009-01-09 14:12:31 +0000
+++ b/mysql-test/include/wait_for_slave_sql_error_and_skip.inc	2010-04-21 17:22:00 +0000
@@ -29,6 +29,7 @@ source include/wait_for_slave_sql_error.
 if ($show_sql_error)
 {
   let $error= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
+  let $error= `SELECT SUBSTRING("$error" FROM 17)`;
   echo Last_SQL_Error = $error;
 }
 

=== 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-21 17:22:00 +0000
@@ -41,7 +41,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	0
 Last_IO_Error	
 Last_SQL_Errno	#
-Last_SQL_Error	Failed during slave thread initialization
+Last_SQL_Error	YYMMDD HH:MM:SS Failed during slave thread initialization
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	0
 SET GLOBAL debug="";

=== 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-21 17:22:00 +0000
@@ -585,7 +585,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
+Last_SQL_Error	YYMMDD HH:MM:SS Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
@@ -662,7 +662,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
+Last_SQL_Error	YYMMDD HH:MM:SS Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
@@ -815,7 +815,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 STOP SLAVE;
@@ -903,7 +903,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 STOP SLAVE;
@@ -991,7 +991,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 STOP 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-21 17:22:00 +0000
@@ -585,7 +585,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
+Last_SQL_Error	YYMMDD HH:MM:SS Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
@@ -662,7 +662,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
+Last_SQL_Error	YYMMDD HH:MM:SS Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
@@ -815,7 +815,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 STOP SLAVE;
@@ -903,7 +903,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 STOP SLAVE;
@@ -991,7 +991,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 STOP SLAVE;

=== 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-21 17:22:00 +0000
@@ -63,7 +63,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	0
 Last_IO_Error	
 Last_SQL_Errno	1590
-Last_SQL_Error	The incident LOST_EVENTS occured on the master. Message: <none>
+Last_SQL_Error	YYMMDD HH:MM:SS The incident LOST_EVENTS occured on the master. Message: <none>
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;

=== 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-21 17:22:00 +0000
@@ -49,7 +49,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	0
 Last_IO_Error	
 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'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT * FROM t1;
@@ -138,7 +138,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	0
 Last_IO_Error	
 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 (field_1, field_2, field_3)
+Last_SQL_Error	YYMMDD HH:MM:SS 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 (field_1, field_2, field_3)
 SELECT t2.field_a, t2.field_b, t2.field_c
 FROM t2
 ON DUPLICATE KEY UPDATE

=== 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-21 17:22:00 +0000
@@ -86,7 +86,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1593
-Last_SQL_Error	Fatal error: Not enough memory
+Last_SQL_Error	YYMMDD HH:MM:SS Fatal error: Not enough memory
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;

=== 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-21 17:22:00 +0000
@@ -56,7 +56,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -112,7 +112,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -168,7 +168,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 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)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -225,7 +225,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float'
+Last_SQL_Error	YYMMDD HH:MM:SS Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SELECT COUNT(*) FROM t1;
@@ -282,7 +282,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -338,7 +338,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -395,7 +395,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')'
+Last_SQL_Error	YYMMDD HH:MM:SS Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SELECT COUNT(*) FROM t1;
@@ -452,7 +452,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -540,7 +540,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -597,7 +597,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -653,7 +653,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -709,7 +709,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)'
+Last_SQL_Error	YYMMDD HH:MM:SS 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
 SELECT COUNT(*) FROM t1;
@@ -766,7 +766,7 @@ Master_SSL_Verify_Server_Cert	No
 Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1658
-Last_SQL_Error	Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob'
+Last_SQL_Error	YYMMDD HH:MM:SS Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob'
 Replicate_Ignore_Server_Ids	
 Master_Server_Id	1
 SELECT COUNT(*) FROM t1;

=== added file 'mysql-test/suite/rpl/r/rpl_show_errors.result'
--- a/mysql-test/suite/rpl/r/rpl_show_errors.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_show_errors.result	2010-04-21 17:22:00 +0000
@@ -0,0 +1,39 @@
+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;
+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;
+CREATE TABLE t1 (a INT, b blob, PRIMARY KEY(b(512)));
+DROP TABLE t1;
+DROP TABLE t1;
+# assertion: timestamp should be filled
+include/stop_slave.inc
+# assertion: show that error is preserved after stop slave as well as the timestamp
+CREATE TABLE  t1 (a INT, b blob, PRIMARY KEY(b(512)));
+include/start_slave.inc
+# assertion: show that the error is not reported anymore since replication
+#            has resumed correctly
+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;
+RESET MASTER;
+include/stop_slave.inc
+change master to master_port=SLAVE_PORT;
+START SLAVE;
+*** must be having the replicate-same-server-id IO thread error ***
+# assertion: assert that error has been reported as well as a timestamp
+include/stop_slave.inc
+# assertion: show that error is preserved after stop slave as well as the timestamp
+change master to master_port=MASTER_PORT;
+include/start_slave.inc
+# assertion: show that no error is reported anymore

=== modified file 'mysql-test/suite/rpl/t/rpl_binlog_corruption.test'
--- a/mysql-test/suite/rpl/t/rpl_binlog_corruption.test	2009-04-15 11:43:17 +0000
+++ b/mysql-test/suite/rpl/t/rpl_binlog_corruption.test	2010-04-21 17:22:00 +0000
@@ -37,6 +37,7 @@ START SLAVE SQL_THREAD;
 let $slave_sql_errno= 1594; # ER_SLAVE_RELAY_LOG_READ_FAILURE
 source include/wait_for_slave_sql_error.inc;
 let $error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+let $error= `SELECT SUBSTRING("$error" FROM 17)`;
 --echo Last_SQL_Error = $error
 
 --echo ==== Clean up ====

=== modified file 'mysql-test/suite/rpl/t/rpl_bug33931.test'
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test	2009-11-27 23:34:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test	2010-04-21 17:22:00 +0000
@@ -41,6 +41,7 @@ source include/wait_for_slave_to_stop.in
 
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 query_vertical show slave status;
 
 #

=== modified file 'mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test'
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test	2010-01-27 02:52:13 +0000
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test	2010-04-21 17:22:00 +0000
@@ -59,6 +59,7 @@ source include/wait_for_slave_param.inc;
 --echo *** must be having the replicate-same-server-id IO thread error ***
 let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
 let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1);
+let $last_io_error= `SELECT SUBSTRING("$last_io_error" FROM 17)`;
 echo Slave_IO_Errno= $last_io_errno;
 echo Slave_IO_Error= $last_io_error;
 

=== modified file 'mysql-test/suite/rpl/t/rpl_incident.test'
--- a/mysql-test/suite/rpl/t/rpl_incident.test	2009-05-02 19:28:54 +0000
+++ b/mysql-test/suite/rpl/t/rpl_incident.test	2010-04-21 17:22:00 +0000
@@ -25,6 +25,7 @@ SELECT * FROM t1;
 
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
@@ -37,6 +38,7 @@ START SLAVE;
 SELECT * FROM t1;
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical SHOW SLAVE STATUS
 
 connection master;

=== modified file 'mysql-test/suite/rpl/t/rpl_known_bugs_detection.test'
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test	2009-11-27 23:34:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test	2010-04-21 17:22:00 +0000
@@ -28,6 +28,7 @@ connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 # show the error message
 --replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical show slave status;
 # show that it was not replicated
 SELECT * FROM t1;
@@ -84,6 +85,7 @@ connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 # show the error message
 --replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
+--replace_regex /[0-9][0-9][0-9][0-9][0-9][0-9] [0-9]+:[0-9]+:[0-9]+/YYMMDD HH:MM:SS/
 --query_vertical show slave status;
 # show that it was not replicated
 SELECT * FROM t1;

=== modified file 'mysql-test/suite/rpl/t/rpl_manual_change_index_file.test'
--- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test	2010-01-08 15:32:40 +0000
+++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test	2010-04-21 17:22:00 +0000
@@ -60,6 +60,7 @@ call mtr.add_suppression('Got fatal erro
 connection slave;
 source include/wait_for_slave_io_to_stop.inc;
 let $last_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
+let $last_error= `SELECT SUBSTRING("$last_error" FROM 17)`;
 echo Last_IO_Error;
 echo $last_error;
 

=== modified file 'mysql-test/suite/rpl/t/rpl_packet.test'
--- a/mysql-test/suite/rpl/t/rpl_packet.test	2009-11-27 23:34:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_packet.test	2010-04-21 17:22:00 +0000
@@ -89,6 +89,7 @@ let $slave_io_running= query_get_value(S
 # event, However there is no Last_IO_Error report.
 #
 let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
+let $last_io_error= `SELECT SUBSTRING("$last_io_error" FROM 17)`;
 eval SELECT "$last_io_error" AS Last_IO_Error;
 
 #
@@ -112,6 +113,7 @@ connection slave;
 let $slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
 --echo Slave_IO_Running = $slave_io_running (expect No)
 let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
+let $last_io_error= `SELECT SUBSTRING("$last_io_error" FROM 17)`;
 eval SELECT "$last_io_error" AS Last_IO_Error;
 
 --echo ==== clean up ====

=== modified file 'mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test'
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test	2008-07-10 16:09:39 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test	2010-04-21 17:22:00 +0000
@@ -32,6 +32,7 @@ connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 # see if we have a good error message:
 let $err= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+let $err= `SELECT SUBSTRING("$err" FROM 17)`;
 --echo Last_SQL_Error = $err
 
 --echo ==== Clean up ====

=== modified file 'mysql-test/suite/rpl/t/rpl_server_id1.test'
--- a/mysql-test/suite/rpl/t/rpl_server_id1.test	2008-08-04 05:04:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_server_id1.test	2010-04-21 17:22:00 +0000
@@ -20,5 +20,8 @@ source include/wait_for_slave_param.inc;
 --echo *** must be having the replicate-same-server-id IO thread error ***
 let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
 let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1);
+
 echo Slave_IO_Errno= $last_io_errno;
+# chop the error timestamp
+let $last_io_error= `SELECT SUBSTRING("$last_io_error" FROM 17)`;
 echo Slave_IO_Error= $last_io_error;

=== added file 'mysql-test/suite/rpl/t/rpl_show_errors.test'
--- a/mysql-test/suite/rpl/t/rpl_show_errors.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_show_errors.test	2010-04-21 17:22:00 +0000
@@ -0,0 +1,118 @@
+-- source include/master-slave.inc
+
+# There is no point in running this test in more
+# than once, ie, one for each binary log format.
+-- source include/have_binlog_format_row.inc
+
+#
+# BUG#43535: last_io_error in show slave status is confusing
+#
+
+############# CHECKS SQL ERRORS #############
+-- source include/master-slave-reset.inc
+-- connection master
+CREATE TABLE t1 (a INT, b blob, PRIMARY KEY(b(512)));
+-- sync_slave_with_master
+# action: remove table on the slave to force SQL error
+DROP TABLE t1;
+
+-- connection master
+# action: drop the table on the master
+DROP TABLE t1; 
+
+-- connection slave
+# action: now  wait for the slave to stop because it cannot
+#         remove a table that does not exist
+-- source include/wait_for_slave_sql_to_stop.inc
+
+-- echo # assertion: timestamp should be filled
+-- let $errmsg0= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+-- let $errts0= `SELECT SUBSTRING("$errmsg0" FROM 1 FOR 15)`
+if (`SELECT (NOT STRCMP("$errts0", "") OR NOT ("$errts0" REGEXP "[0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]"))`)
+{
+  -- echo Timestamp does not match the expected one: expected '#### ##:##:##', got: '$errts0' 
+  -- die
+}
+
+# action: stop the slave (this should preserve the error)
+-- source include/stop_slave.inc
+-- let $errmsg1= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+-- echo # assertion: show that error is preserved after stop slave as well as the timestamp
+if (`SELECT (STRCMP("$errmsg0", "$errmsg1"))`)
+{
+  -- let $errts1= `SELECT SUBSTRING("$errmsg1" FROM 1 FOR 15)`
+  -- echo timestamp { got: "$errts1", expected: "$errts0" }, message { got: "$errmsg1", expected: "$errmsg0" }
+  -- die
+}
+
+-- connection slave
+# action: create the table again on the slave so that it resumes replication
+#         correctly when we restart the slave
+CREATE TABLE  t1 (a INT, b blob, PRIMARY KEY(b(512)));
+-- source include/start_slave.inc
+
+-- echo # assertion: show that the error is not reported anymore since replication
+-- echo #            has resumed correctly
+-- let $errmsg2= query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1)
+if (`SELECT STRCMP("$errmsg2", "")`)
+{
+  -- let $errts2= `SELECT SUBSTRING("$errmsg2" FROM 1 FOR 15)`
+  -- echo timestamp { got: "$errts2", expected: "" }, message { got: "$errmsg2", expected: "" }
+  -- die
+}
+
+############# CHECKS IO ERRORS #############
+
+-- connection master
+-- source include/master-slave-reset.inc
+
+# mostly copied and extended from rpl_server_id1.test
+-- connection slave
+RESET MASTER;
+
+# replicate ourselves
+-- source include/stop_slave.inc
+-- replace_result $SLAVE_MYPORT SLAVE_PORT
+-- eval change master to master_port=$SLAVE_MYPORT
+START SLAVE;
+
+-- let $slave_param= Last_IO_Errno
+-- let $slave_param_value= 1593
+-- source include/wait_for_slave_param.inc
+-- echo *** must be having the replicate-same-server-id IO thread error ***
+
+-- echo # assertion: assert that error has been reported as well as a timestamp
+-- let $errmsg0= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1)
+-- let $errts0= `SELECT SUBSTRING("$errmsg0" FROM 1 FOR 15)`
+if (`SELECT (NOT STRCMP("$errts0", "") OR NOT ("$errts0" REGEXP "[0-9][0-9][0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]"))`)
+{
+  -- echo Timestamp does not match the expected one: expected '#### ##:##:##', got: '$errts0' 
+  -- die
+}
+
+# action: stop the slave
+-- source include/stop_slave.inc
+
+-- let $errmsg1= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1)
+-- echo # assertion: show that error is preserved after stop slave as well as the timestamp
+if (`SELECT (STRCMP("$errmsg0", "$errmsg1"))`)
+{
+  -- let $errts1= `SELECT SUBSTRING("$errmsg1" FROM 1 FOR 15)`
+  -- echo timestamp { got: "$errts1", expected: "$errts0" }, message { got: "$errmsg1", expected: "$errmsg0" }
+  -- die
+}
+
+# action: restore correct settings
+-- replace_result $MASTER_MYPORT MASTER_PORT
+-- eval change master to master_port=$MASTER_MYPORT
+-- source include/start_slave.inc
+
+-- echo # assertion: show that no error is reported anymore
+-- let $errmsg2= query_get_value("SHOW SLAVE STATUS", Last_IO_Error, 1)
+if (`SELECT STRCMP("$errmsg2", "")`)
+{
+  -- let $errts2= `SELECT SUBSTRING("$errmsg2" FROM 1 FOR 15)`
+  -- echo timestamp { got: "$errts2", expected:"" }, message { got: "$errmsg2", expected: "" }
+  -- die
+}
+

=== modified file 'sql/rpl_reporting.cc'
--- a/sql/rpl_reporting.cc	2009-06-16 15:04:30 +0000
+++ b/sql/rpl_reporting.cc	2010-04-21 17:22:00 +0000
@@ -24,6 +24,7 @@ Slave_reporting_capability::report(logle
     pbuff= m_last_error.message;
     pbuffsize= sizeof(m_last_error.message);
     m_last_error.number = err_code;
+    m_last_error.update_timestamp();
     report_function= sql_print_error;
     break;
   case WARNING_LEVEL:

=== modified file 'sql/rpl_reporting.h'
--- a/sql/rpl_reporting.h	2009-06-16 15:04:30 +0000
+++ b/sql/rpl_reporting.h	2010-04-21 17:22:00 +0000
@@ -67,12 +67,36 @@ public:
     {
       number= 0;
       message[0]= '\0';
+      timestamp[0]= '\0';
+
+    }
+
+    void update_timestamp()
+    {
+      time_t skr;
+      struct tm tm_tmp;
+      struct tm *start;
+
+      skr= my_time(0);
+      localtime_r(&skr, &tm_tmp);
+      start=&tm_tmp;
+
+      my_sprintf(timestamp, (timestamp, "%02d%02d%02d %02d:%02d:%02d", 
+                         start->tm_year % 100,
+                         start->tm_mon+1,
+                         start->tm_mday,
+                         start->tm_hour,
+                         start->tm_min,
+                         start->tm_sec));
+      timestamp[15]= '\0';
     }
 
     /** Error code */
     uint32 number;
     /** Error message */
     char message[MAX_SLAVE_ERRMSG];
+    /** Error timestamp as string */
+    char timestamp[16];
   };
 
   Error const& last_error() const { return m_last_error; }

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2010-02-12 23:30:44 +0000
+++ b/sql/slave.cc	2010-04-21 17:22:00 +0000
@@ -1840,11 +1840,30 @@ bool show_master_info(THD* thd, Master_i
     // Last_IO_Errno
     protocol->store(mi->last_error().number);
     // Last_IO_Error
-    protocol->store(mi->last_error().message, &my_charset_bin);
+    if (*mi->last_error().message != '\0')
+    {
+      String msg_buf;
+      msg_buf.append(mi->last_error().timestamp);
+      msg_buf.append(" ");
+      msg_buf.append(mi->last_error().message);
+      protocol->store(msg_buf.c_ptr_safe(), &my_charset_bin);
+    }
+    else
+      protocol->store(mi->last_error().message, &my_charset_bin);
     // Last_SQL_Errno
     protocol->store(mi->rli.last_error().number);
     // Last_SQL_Error
-    protocol->store(mi->rli.last_error().message, &my_charset_bin);
+    if (*mi->rli.last_error().message != '\0')
+    {
+      String msg_buf;
+      msg_buf.append(mi->rli.last_error().timestamp);
+      msg_buf.append(" ");
+      msg_buf.append(mi->rli.last_error().message);
+      protocol->store(msg_buf.c_ptr_safe(), &my_charset_bin);
+    }
+    else
+      protocol->store(mi->rli.last_error().message, &my_charset_bin);
+
     // Replicate_Ignore_Server_Ids
     {
       char buff[FN_REFLEN];


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20100421172200-6cv2yw0gnkxpz8e4.bundle
Thread
bzr commit into mysql-5.1-rep+2 branch (luis.soares:3183) Bug#43535Luis Soares21 Apr