maria-developers team mailing list archive
-
maria-developers team
-
Mailing list archive
-
Message #01047
WL40: Notes/questions
With WL36 and WL40 we have:
mysqlbinlog options:
--database=db
--rewrite-db=db_from->db_to
--do-table=db.tbl
--ignore-table=db.tbl
--wild-do-table=pattern.pattern
--wild-ignore-table=pattern.pattern
replication options:
--replicate-rewrite-db=db_from->db_to
--replicate-do-db=db
--replicate-ignore-db=db
--replicate-do-table=tbl
--replicate-ignore-table=tbl
--replicate-wild-do-table=db.tbl
--replicate-wild-ignore-table=db.tbl
1. In mysqlbinlog we do not have --do_db and --ignore_db options.
Does it mean that instead it is supposed to use:
--replicate-wild-do-table=db.%
--replicate-wild-ignore-table=db.%
respectively?
Compared with other options, --database option looks like
a "foreign body" :
- contrary to other options, it allows to specify only one
database (with multiple --database's only the last one is
used);
- having with --database an analog of do_db, we have no
similar analog of ignore_db.
2. In replication two functions are used for filtering databases:
- db_ok(const char* db) which matches db only with do-db and
ignore-db rules;
- db_ok_with_wild_table(const char* db) which matches db only
with wild-do-table=db.% and wild-ignore-table=db.% rules.
This function is applied only to CREATE DB, DROP DB, and
ALTER DATABASE statements.
In mysqlbinlog, should we follow the same scheme, namely:
- db_ok() for matching db with --database option only;
- db_ok_with_wild_table() for statements listed above?
3. According to replication filtering rules, --replicate-rewrite_db
is always done _before_ other --replicate-* rules are tested;
see explanation for --replicate-rewrite-db in RefMan (16.1.3.3.
Replication Slave Options and Variables), or the following piece
of code in og_event.cc:
int Table_map_log_event::do_apply_event(Relay_log_info const* rli)
{
RPL_TABLE_LIST* table_list;
...
strmov(table_list->db, rpl_filter->get_rewrite_db(m_dbnam, &dummy_len));
...
if (...!rpl_filter->db_ok(table_list->db) ...)
...
}
And what about --database + rewrite-db for mysqlbinlog? If we mean to
output only database xxx with renaming it to yyy, should we use
(1) mysqlbinlog --database=xxx --rewrite-db=xxx->yyy
or
(2) mysqlbinlog --database=yyy --rewrite-db=xxx->yyy
In current WL36 design it is supposed that (1) should be used
(surely, this can easily be redesigned). But this becomes confused
with using of --wild-do-table + replication filtering rules,
for which we should use:
(3) --wild-do-table=yyy.% --rewrite-db=xxx->yyy
Follow ups