summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authormats@mysql.com <>2005-02-23 19:58:54 +0100
committermats@mysql.com <>2005-02-23 19:58:54 +0100
commit6ad51ffb3cd90cb80d53504856c22592e1a6b075 (patch)
tree82893cc72fc828aba1e57e447573329e17425c52 /sql/log.cc
parent772b1cedcd4489078b48fbc1cf36918ba9612c6d (diff)
parenta4cdb93b38081a9e0c52223e576a3d82f57e9e29 (diff)
downloadmariadb-git-6ad51ffb3cd90cb80d53504856c22592e1a6b075.tar.gz
Bug#8412: Merge from 4.0
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 46b44837e0f..32574ca4a0d 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1389,6 +1389,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
p= strmov(strmov(buf, "SET CHARACTER SET "),
thd->variables.convert_set->name);
Query_log_event e(thd, buf, (ulong) (p - buf), 0);
+ e.error_code = 0; // This statement cannot fail (see [1]).
e.set_log_pos(this);
if (e.write(file))
goto err;
@@ -1407,12 +1408,22 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
{
Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0, FALSE);
e.set_log_pos(this);
+ e.error_code = 0; // This statement cannot fail (see [1]).
if (e.write(file))
goto err;
}
}
- /* Write the SQL command */
+ /*
+ Write the SQL command
+
+ [1] If this statement has an error code, the slave is required to fail
+ with the same error code or stop. The preamble and epilogue should
+ *not* have this error code since the execution of those is
+ guaranteed *not* to produce any error code. This would therefore
+ stop the slave even if the execution of the real statement can be
+ handled gracefully by the slave.
+ */
event_info->set_log_pos(this);
if (event_info->write(file))
@@ -1426,6 +1437,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
{
Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0, FALSE);
e.set_log_pos(this);
+ e.error_code = 0; // This statement cannot fail (see [1]).
if (e.write(file))
goto err;
}