diff options
author | Sujatha Sivakumar <sujatha.sivakumar@oracle.com> | 2013-03-27 11:53:01 +0530 |
---|---|---|
committer | Sujatha Sivakumar <sujatha.sivakumar@oracle.com> | 2013-03-27 11:53:01 +0530 |
commit | 0e763f4db5e024e75fdedb9bc3c3cbd1a45ed9e5 (patch) | |
tree | 67613f83d2a2fb9b688adf3c57548f796241cdf9 /sql/rpl_filter.cc | |
parent | 1ea6eb143aed2c33e2a1db6caa2067e1490ebab5 (diff) | |
download | mariadb-git-0e763f4db5e024e75fdedb9bc3c3cbd1a45ed9e5.tar.gz |
Bug#11829838: ALTER TABLE NOT BINLOGGED WITH
--BINLOG-IGNORE-DB AND FULLY QUALIFIED TABLE
Problem:
=======
An ALTER TABLE statement is not written to binlog if server
started with "--binlog-ignore-db some database" and 'fully
qualified' table names are used in the ALTER TABLE statement
altering table different from current database context.
Analysis:
========
The above mentioned problem not only affects "ALTER TABLE"
statements but also to all kind of statements. Once the
current default database becomes "NULL" none of the
statements will be binlogged.
The current behaviour is such that if the user has specified
restrictions on which database needs to be replicated and the
default db is not specified, then do not replicate.
This means that "NULL" is considered to be equivalent to
everything (default db = null implied ignore don't log the
statement).
Fix:
===
"NULL" should not be considered as equivalent to everything.
Since the filtering criteria is not equal to "NULL" the
statement should be logged into binlog.
mysql-test/suite/rpl/r/rpl_loaddata_m.result:
Earlier when defalut database was "NULL" DROP TABLE
was not getting logged. Post this fix it will be logged
and the DROP will fail at slave as the table creation
was skipped by master as --binlog-ignore-db=test.
mysql-test/suite/rpl/t/rpl_loaddata_m.test:
Earlier when defalut database was "NULL" DROP TABLE
was not getting logged. Post this fix it will be logged
and the DROP will fail at slave as the table creation
was skipped by master as --binlog-ignore-db=test.
sql/rpl_filter.cc:
Replaced DBUG_RETURN(0) with DBUG_RETURN(1).
Diffstat (limited to 'sql/rpl_filter.cc')
-rw-r--r-- | sql/rpl_filter.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/rpl_filter.cc b/sql/rpl_filter.cc index 3d38c243a0a..cee518ebf0f 100644 --- a/sql/rpl_filter.cc +++ b/sql/rpl_filter.cc @@ -154,11 +154,14 @@ Rpl_filter::db_ok(const char* db) DBUG_RETURN(1); // Ok to replicate if the user puts no constraints /* - If the user has specified restrictions on which databases to replicate - and db was not selected, do not replicate. + Previous behaviour "if the user has specified restrictions on which + databases to replicate and db was not selected, do not replicate" has + been replaced with "do replicate". + Since the filtering criteria is not equal to "NULL" the statement should + be logged into binlog. */ if (!db) - DBUG_RETURN(0); + DBUG_RETURN(1); if (!do_db.is_empty()) // if the do's are not empty { |