Bug #2611 calling stored procedure on replication master causes all slaves to crash
Submitted: 2 Feb 2004 7:43 Modified: 20 Apr 2005 21:48
Reporter: Bill Au Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.0 OS:Linux (RedHat 7.3)
Assigned to: Guilhem Bichot CPU Architecture:Any

[2 Feb 2004 7:43] Bill Au
Description:
Calling a stored procedure on the replication master crashes all the slave.
The procedure was created on the slaves manually because the
"create procedure" statement was not replicated (see bug 2610).
After that, calling the procedure on the master crashes all the slaves.

How to repeat:
Run the following two SQL statements on the master:

create table testtable
(
        id      INT
);
                                                                       
create procedure testproc ()
insert into testtable (id) values (123456);

Table is created on master and slaves but procedure is created only on
master.  Run the following SQL statement on all slaves:

create procedure testproc ()
insert into testtable (id) values (123456);

Now call the procedure on master:

call testproc();

This will crash all slaves with the following error messages being displayed
on the slave:

mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
 
key_buffer_size=8388600
read_buffer_size=131072
max_used_connections=1
max_connections=100
threads_connected=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
thd=0x858d6b0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x41752168, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x813effc
0x4002547e
0x4207931a
0x81543a0
0x8155691
0x819716a
0x81e53c2
0x81e3d47
0x4001f941
0x420da1ca
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/en/Using_stack_trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd->query at 0x85e2239 = call testproc()
thd->thread_id=2
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
[5 Feb 2004 13:35] Dean Ellis
I cannot repeat this against the current 5.0 tree.  The slave merely logs:

ERROR: 1289  PROCEDURE testproc does not exist

and continues on.  This was possibly caused by another bug (2269, for instance) that has already been corrected.
[5 Feb 2004 13:39] Bill Au
In order to reproduce this bug, the procedure has to be created manually
on the slave servers (since create procedure is not replicated, see bug 2610).
Once the procedure exists on the slaves, the slaves will crash if the
procedure is called on the master.
[5 Feb 2004 15:28] Dean Ellis
Sorry, that was my oversight.

Verified against current 5.0 bk tree.  Also crashes if the procedure specifies the database name for the table in which it is inserting.

Thank you.
[19 Apr 2005 9:27] Guilhem Bichot
Too hard and imperfect with statement-level binary logging of 5.0. Will be fixed in 5.1 with record-level binary logging.
[20 Apr 2005 21:48] Guilhem Bichot
Finally I fixed it in 5.0.5.