From 6dd90cc9b32adc49877749d1e685372d0556d242 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Sun, 6 Dec 2009 19:51:48 +0200 Subject: [PATCH] Fixed bug #49474 Replication from 4.0 to 5.1 broken Reviewer: knielsens sql/slave.cc: For 4.0 server (with no time_zone variable), don't stop replication but give a warning --- sql/slave.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index 94e20b594fb..5de79d55b31 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1117,18 +1117,27 @@ be equal for the Statement-format replication to work"; goto err; } } - else if (is_network_error(mysql_errno(mysql))) + else if (is_network_error(err_code= mysql_errno(mysql))) { - mi->report(WARNING_LEVEL, mysql_errno(mysql), - "Get master TIME_ZONE failed with error: %s", mysql_error(mysql)); + mi->report(ERROR_LEVEL, err_code, + "Get master TIME_ZONE failed with error: %s", + mysql_error(mysql)); goto network_err; - } + } + else if (err_code == ER_UNKNOWN_SYSTEM_VARIABLE) + { + /* We use ERROR_LEVEL to get the error logged to file */ + mi->report(ERROR_LEVEL, err_code, + + "MySQL master doesn't have a TIME_ZONE variable. Note that" + "if your timezone is not same between master and slave, your " + "slave may get wrong data into timestamp columns"); + } else { /* Fatal error */ errmsg= "The slave I/O thread stops because a fatal error is encountered \ when it try to get the value of TIME_ZONE global variable from master."; - err_code= mysql_errno(mysql); sprintf(err_buff, "%s Error: %s", errmsg, mysql_error(mysql)); goto err; }