mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Bug#15942 (RBR ignored --binlog_ignore_db and tries to map table on slave for writes):
Added code to do the filtering (seems to have gone away).
This commit is contained in:
parent
f86fd78261
commit
3440170618
4 changed files with 80 additions and 2 deletions
45
mysql-test/r/rpl_row_basic_11bugs.result
Normal file
45
mysql-test/r/rpl_row_basic_11bugs.result
Normal file
|
@ -0,0 +1,45 @@
|
|||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE DATABASE test_ignore;
|
||||
**** On Master ****
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
information_schema
|
||||
mysql
|
||||
test
|
||||
test_ignore
|
||||
USE test;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
t1
|
||||
INSERT INTO t1 VALUES (1,1), (2,2);
|
||||
USE test_ignore;
|
||||
CREATE TABLE t2 (a INT, b INT);
|
||||
SHOW TABLES;
|
||||
Tables_in_test_ignore
|
||||
t2
|
||||
INSERT INTO t2 VALUES (3,3), (4,4);
|
||||
SHOW BINLOG EVENTS;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 4 Format_desc 1 102 Server ver: 5.1.5-alpha-debug-log, Binlog ver: 4
|
||||
master-bin.000001 102 Query 1 195 use `test`; CREATE TABLE t1 (a INT, b INT)
|
||||
master-bin.000001 195 Table_map 1 235 test.t1
|
||||
master-bin.000001 235 Write_rows 1 282
|
||||
**** On Slave ****
|
||||
SHOW DATABASES;
|
||||
Database
|
||||
information_schema
|
||||
mysql
|
||||
test
|
||||
USE test;
|
||||
SHOW TABLES;
|
||||
Tables_in_test
|
||||
t1
|
||||
USE test_ignore;
|
||||
ERROR 42000: Unknown database 'test_ignore'
|
||||
DROP DATABASE test_ignore;
|
1
mysql-test/t/rpl_row_basic_11bugs-master.opt
Normal file
1
mysql-test/t/rpl_row_basic_11bugs-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--binlog_ignore_db=test_ignore;
|
31
mysql-test/t/rpl_row_basic_11bugs.test
Normal file
31
mysql-test/t/rpl_row_basic_11bugs.test
Normal file
|
@ -0,0 +1,31 @@
|
|||
--source include/have_row_based.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
|
||||
# Bug#15942 (RBR ignores --binlog_ignore_db and tries to map to table
|
||||
# on slave for writes)
|
||||
|
||||
CREATE DATABASE test_ignore; # --binlog_ignore_db=mysqltest_ignore
|
||||
|
||||
--echo **** On Master ****
|
||||
SHOW DATABASES;
|
||||
USE test;
|
||||
CREATE TABLE t1 (a INT, b INT);
|
||||
SHOW TABLES;
|
||||
INSERT INTO t1 VALUES (1,1), (2,2);
|
||||
USE test_ignore;
|
||||
CREATE TABLE t2 (a INT, b INT);
|
||||
SHOW TABLES;
|
||||
INSERT INTO t2 VALUES (3,3), (4,4);
|
||||
SHOW BINLOG EVENTS;
|
||||
sync_slave_with_master;
|
||||
--echo **** On Slave ****
|
||||
SHOW DATABASES;
|
||||
USE test;
|
||||
SHOW TABLES;
|
||||
--error 1049
|
||||
USE test_ignore;
|
||||
|
||||
connection master;
|
||||
DROP DATABASE test_ignore;
|
||||
sync_slave_with_master;
|
|
@ -2797,7 +2797,7 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
|
|||
- Row-based replication is on
|
||||
- It is not a temporary table
|
||||
- The binlog is enabled
|
||||
- The table shall be binlogged (binlog_*_db rules) [Seems disabled /Matz]
|
||||
- The table shall be binlogged (binlog_*_db rules)
|
||||
*/
|
||||
|
||||
#ifdef HAVE_ROW_BASED_REPLICATION
|
||||
|
@ -2806,7 +2806,8 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table)
|
|||
return
|
||||
binlog_row_based &&
|
||||
thd && (thd->options & OPTION_BIN_LOG) &&
|
||||
(table->s->tmp_table == NO_TMP_TABLE);
|
||||
(table->s->tmp_table == NO_TMP_TABLE) &&
|
||||
binlog_filter->db_ok(table->s->db.str);
|
||||
}
|
||||
|
||||
template<class RowsEventT> int binlog_log_row(TABLE* table,
|
||||
|
|
Loading…
Reference in a new issue