summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2009-12-06 19:51:48 +0200
committerMichael Widenius <monty@askmonty.org>2009-12-06 19:51:48 +0200
commit6dd90cc9b32adc49877749d1e685372d0556d242 (patch)
tree56f60635472191c2e9a574b7f6beeaa36d2c01e1 /sql/slave.cc
parent17a7debbe3944da83d7b080846ed1748d5238640 (diff)
downloadmariadb-git-6dd90cc9b32adc49877749d1e685372d0556d242.tar.gz
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
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc19
1 files 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;
}