Bug #14769 | Function fails to replicate if fails half-way (slave stops) | ||
---|---|---|---|
Submitted: | 8 Nov 2005 20:23 | Modified: | 22 Feb 2006 17:59 |
Reporter: | Guilhem Bichot | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.0 | OS: | Linux (linux) |
Assigned to: | Guilhem Bichot | CPU Architecture: | Any |
[8 Nov 2005 20:23]
Guilhem Bichot
[16 Nov 2005 13:21]
Guilhem Bichot
it's not a crash but still will make slave stop in a not-so-rare situation, so raising it to P2.
[19 Jan 2006 13:27]
Guilhem Bichot
The bug was observed when the user issues "select fn1()", but also exists when he issues "do fn1()", indeed in "do fn1()", the error recorded in binlog is 1062 even if DO returns 0 (this is because binlogging happens before the error code is cleared), and slave executes DO, ends up with an error code of 0, and compares that to 1062, so fails. The solution to both problems is unique: binlog "SELECT fn1()" instead of "DO fn1()" (and then "do fn1()" will be binlogged as "SELECT fn1()").
[19 Jan 2006 13:34]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/1345
[20 Jan 2006 12:56]
Guilhem Bichot
Setting back to "patch pending", for Sergey's second approval.
[24 Jan 2006 14:57]
Guilhem Bichot
I will push the fix in 5.0 and 5.1 when 5.1 gets up to date first. SergeyP's comment which I should implement is update the big comment in sp_head.cc.
[18 Feb 2006 16:27]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/2851
[18 Feb 2006 16:35]
Guilhem Bichot
ChangeSet 1.2062 06/02/18 17:26:30 guilhem@mysql.com +5 -0 Fix for BUG#14769 "Function fails to replicate if fails half-way (slave stops)": if the function, invoked in a non-binlogged caller (e.g. SELECT, DO), failed half-way on the master, slave would stop and complain that error code between him and master mismatch. To solve this, when a stored function is invoked in a non-binlogged caller (e.g. SELECT, DO), we binlog the function call as SELECT instead of as DO (see revision comment of sp_head.cc for more).
[18 Feb 2006 20:34]
Guilhem Bichot
the fix is in 5.0.19 and 5.1.8
[22 Feb 2006 17:59]
Paul DuBois
Note in 5.0.19, 5.1.7 changelogs. Previously, a stored function invocation was written to the binary log as <literal>DO <replaceable>func_name</replaceable>()</literal> if the invocation changes data and occurs within a non-logged statement, or if the function invokes a stored procedure that produces an error. These invocations now are logged as <literal>SELECT <replaceable>func_name</replaceable>()</literal> instead for better control over error code checking (slave servers could stop due to detecting a different error than occurred on the master). (Bug #14769)