mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
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.
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user