Commit c6ee6093 authored by unknown's avatar unknown

BUG#17521 alter database crashes slave

Problem was a null pointer
Fixed by passing correct database name to slave filtering mechanism
Added test.


sql/sql_parse.cc:
  Fix slave crash when issuing 'ALTER DATABASE' with specifying db name
  Don't pass null pointer to db_ok_with_wild_table()
parent b9697b20
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
use mysql;
alter database collate latin1_bin;
source include/master-slave.inc;
connection master;
use mysql; # to be different from initial `test' db of mysqltest client
alter database collate latin1_bin;
save_master_pos;
connection slave;
sync_with_master;
......@@ -3715,7 +3715,7 @@ end_with_restore_list:
}
if (!strip_sp(db) || check_db_name(db))
{
my_error(ER_WRONG_DB_NAME, MYF(0), lex->name);
my_error(ER_WRONG_DB_NAME, MYF(0), db);
break;
}
/*
......@@ -3727,8 +3727,8 @@ end_with_restore_list:
*/
#ifdef HAVE_REPLICATION
if (thd->slave_thread &&
(!rpl_filter->db_ok(lex->name) ||
!rpl_filter->db_ok_with_wild_table(lex->name)))
(!rpl_filter->db_ok(db) ||
!rpl_filter->db_ok_with_wild_table(db)))
{
my_message(ER_SLAVE_IGNORED_TABLE, ER(ER_SLAVE_IGNORED_TABLE), MYF(0));
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment