summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-02-28 22:22:29 +0100
committerunknown <guilhem@mysql.com>2004-02-28 22:22:29 +0100
commit57659a4dafded65807472efcb3475e3b9217f4ce (patch)
tree522bb7e1d9c103d8b7f57608c635c7d00ca4082d
parentf5ab07d94899dbd6e8beb0b450e00ab89c581504 (diff)
downloadmariadb-git-57659a4dafded65807472efcb3475e3b9217f4ce.tar.gz
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.
-rw-r--r--sql/sql_parse.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4138380903f..e78bf7d9dcf 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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())