Commit 9844f29a authored by unknown's avatar unknown

Fix for BUG#3000:

"replicate-wild-*-table=db.% does not apply to ALTER DATABASE"
apply replicate-* rules to ALTER DATABASE like we already do
for CREATE DATABASE/ DROP DATABASE.


sql/sql_parse.cc:
  apply replicate-* rules to ALTER DATABASE like we already do
  for CREATE DATABASE/ DROP DATABASE.
parent 50ea9c42
......@@ -3043,6 +3043,22 @@ mysql_execute_command(THD *thd)
net_printf(thd, ER_WRONG_DB_NAME, lex->name);
break;
}
/*
If in a slave thread :
ALTER DATABASE DB may not be preceded by USE DB.
For that reason, maybe db_ok() in sql/slave.cc did not check the
do_db/ignore_db. And as this query involves no tables, tables_ok()
above was not called. So we have to check rules again here.
*/
#ifdef HAVE_REPLICATION
if (thd->slave_thread &&
(!db_ok(lex->name, replicate_do_db, replicate_ignore_db) ||
!db_ok_with_wild_table(lex->name)))
{
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
break;
}
#endif
if (check_access(thd,ALTER_ACL,lex->name,0,1,0))
break;
if (thd->locked_tables || thd->active_transaction())
......
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