Bug #17521 alter database cores slave
Submitted: 17 Feb 2006 9:55 Modified: 27 Feb 2006 20:48
Reporter: Tomas Ulin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.1.7 bk src OS:
Assigned to: Elliot Murphy CPU Architecture:Any

[17 Feb 2006 9:55] Tomas Ulin
Description:
replication running

alter database collate latin1_bin;

slave cores

#0  0x40239cb1 in kill () from /lib/libc.so.6
#1  0x4003f639 in pthread_kill () from /lib/libpthread.so.0
#2  0x08363b85 in write_core (sig=11) at stacktrace.c:220
#3  0x0820e880 in handle_segfault (sig=11) at mysqld.cc:2196
#4  0x40041d69 in __pthread_clock_settime () from /lib/libpthread.so.0
#5  <signal handler called>
#6  0x40286703 in stpcpy () from /lib/libc.so.6
#7  0x083594e3 in Rpl_filter::db_ok_with_wild_table(char const*) (this=0x8914e78, db=0x0) at rpl_filter.cc:226
#8  0x0822e2b2 in mysql_execute_command(THD*) (thd=0x8ca10c8) at sql_parse.cc:3729
#9  0x08234303 in mysql_parse(THD*, char*, unsigned) (thd=0x8ca10c8, inBuf=0x8c5ab11 "alter database collate latin1_bin", length=33)
    at sql_parse.cc:5772

How to repeat:
./mysql-test-run --start-and-exit --do-test=rpl

on slave   "start slave"

on master  "alter database collate latin1_bin"

slave has cored
[17 Feb 2006 9:58] Tomas Ulin
looked at master though seems to be a missing

use <database>;

in the binlog

show binlog events;

| master-bin.000001 | 102 | Query       |         1 |         198 | alter database collate latin1_bin               |
[23 Feb 2006 21:16] 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/3086
[24 Feb 2006 4:20] 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/3095
[24 Feb 2006 4:35] Elliot Murphy
Reviewed by mats and lars.

Problem was that slave was not using the default database name in the replication filtering rules when receiving an ALTER DATABASE command which did not specify a database. Now correctly uses the default db when db is not specified.

Fix has been pushed into the 5.1.7 release clone.
[27 Feb 2006 20:48] Mike Hillyer
Documented in 5.1.7 changelog:

      <listitem>
        <para>
          An <literal>ALTER DATABASE</literal> statement on a
          replication master crashed the slaves. (Bug #17521)
        </para>
      </listitem>