summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <jmiller@mysql.com>2006-02-07 19:19:42 +0100
committerunknown <jmiller@mysql.com>2006-02-07 19:19:42 +0100
commit642762bd3d963ea593bcdad0e33f04e6fe08827b (patch)
tree90922642d9a30f3a51db32b6625a4b03be82ac44
parent44d48d4d0bacfbb5ed0359e20868f1cbaeb09652 (diff)
parent3eb41de8cb5aaafcc0a2ba37863114b4ad7bd2fb (diff)
downloadmariadb-git-642762bd3d963ea593bcdad0e33f04e6fe08827b.tar.gz
Merge jmiller@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into mysql.com:/home/ndbdev/jmiller/clones/mysql-5.1-new
-rw-r--r--mysql-test/r/ndb_binlog_ddl_multi.result12
-rw-r--r--mysql-test/r/ndb_binlog_ignore_db.result10
-rw-r--r--mysql-test/t/ndb_binlog_ddl_multi.test6
-rw-r--r--mysql-test/t/ndb_binlog_ignore_db-master.opt1
-rw-r--r--mysql-test/t/ndb_binlog_ignore_db.test19
-rw-r--r--sql/ha_ndbcluster_binlog.cc7
6 files changed, 49 insertions, 6 deletions
diff --git a/mysql-test/r/ndb_binlog_ddl_multi.result b/mysql-test/r/ndb_binlog_ddl_multi.result
index 46789069324..e9a3f80281d 100644
--- a/mysql-test/r/ndb_binlog_ddl_multi.result
+++ b/mysql-test/r/ndb_binlog_ddl_multi.result
@@ -8,12 +8,12 @@ create database mysqltest;
use mysqltest;
create table t1 (a int primary key) engine=ndb;
create table t2 (a int primary key) engine=ndb;
-show binlog events from 102;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # create database mysqltest
master-bin1.000001 # Query # # use `mysqltest`; create table t1 (a int primary key) engine=ndb
master-bin1.000001 # Query # # use `test`; create table t2 (a int primary key) engine=ndb
-show binlog events from 102;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # create database mysqltest
master-bin.000001 # Query # # use `mysqltest`; create table t1 (a int primary key) engine=ndb
@@ -21,7 +21,7 @@ master-bin.000001 # Query # # use `test`; create table t2 (a int primary key) en
reset master;
reset master;
alter table t2 add column (b int);
-show binlog events from 102;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status
@@ -32,7 +32,7 @@ reset master;
reset master;
ALTER DATABASE mysqltest CHARACTER SET latin1;
drop table mysqltest.t1;
-show binlog events from 102;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1
master-bin.000001 # Query # # BEGIN
@@ -46,7 +46,7 @@ use test;
insert into t2 values (1,2);
drop database mysqltest;
create table t1 (a int primary key) engine=ndb;
-show binlog events from 102;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status
@@ -88,7 +88,7 @@ ENGINE = NDB;
DROP LOGFILE GROUP lg1
ENGINE =NDB;
drop table t1;
-show binlog events from 102;
+show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # CREATE LOGFILE GROUP lg1
ADD UNDOFILE 'undofile.dat'
diff --git a/mysql-test/r/ndb_binlog_ignore_db.result b/mysql-test/r/ndb_binlog_ignore_db.result
new file mode 100644
index 00000000000..8dc2c1ff1f8
--- /dev/null
+++ b/mysql-test/r/ndb_binlog_ignore_db.result
@@ -0,0 +1,10 @@
+drop table if exists t1;
+drop database if exists mysqltest;
+create database mysqltest;
+use mysqltest;
+create table t1 (a int primary key, b int) engine=ndb;
+insert into t1 values (1, 1);
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # use `test`; drop table if exists t1
+drop database mysqltest;
diff --git a/mysql-test/t/ndb_binlog_ddl_multi.test b/mysql-test/t/ndb_binlog_ddl_multi.test
index 17d304db0b1..3aa3b9469fd 100644
--- a/mysql-test/t/ndb_binlog_ddl_multi.test
+++ b/mysql-test/t/ndb_binlog_ddl_multi.test
@@ -33,10 +33,12 @@ create table t1 (a int primary key) engine=ndb;
--connection server2
create table t2 (a int primary key) engine=ndb;
+--replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $binlog_start
--connection server1
+--replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $binlog_start
@@ -51,6 +53,7 @@ reset master;
alter table t2 add column (b int);
--connections server1
+--replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $binlog_start
@@ -70,6 +73,7 @@ ALTER DATABASE mysqltest CHARACTER SET latin1;
drop table mysqltest.t1;
--connection server1
+--replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $binlog_start
@@ -87,6 +91,7 @@ drop database mysqltest;
create table t1 (a int primary key) engine=ndb;
--connection server2
+--replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $binlog_start
@@ -139,5 +144,6 @@ ENGINE =NDB;
drop table t1;
--connection server2
+--replace_result $binlog_start <binlog_start>
--replace_column 2 # 4 # 5 #
--eval show binlog events from $binlog_start
diff --git a/mysql-test/t/ndb_binlog_ignore_db-master.opt b/mysql-test/t/ndb_binlog_ignore_db-master.opt
new file mode 100644
index 00000000000..e3947c0eeed
--- /dev/null
+++ b/mysql-test/t/ndb_binlog_ignore_db-master.opt
@@ -0,0 +1 @@
+--binlog-ignore-db=mysqltest
diff --git a/mysql-test/t/ndb_binlog_ignore_db.test b/mysql-test/t/ndb_binlog_ignore_db.test
new file mode 100644
index 00000000000..a46266f209a
--- /dev/null
+++ b/mysql-test/t/ndb_binlog_ignore_db.test
@@ -0,0 +1,19 @@
+-- source include/have_ndb.inc
+-- source include/have_binlog_format_row.inc
+
+--let $binlog_start=102
+
+--disable_warnings
+drop table if exists t1;
+drop database if exists mysqltest;
+--enable_warnings
+
+create database mysqltest;
+use mysqltest;
+create table t1 (a int primary key, b int) engine=ndb;
+insert into t1 values (1, 1);
+--replace_result $binlog_start <binlog_start>
+--replace_column 2 # 4 # 5 #
+--eval show binlog events from $binlog_start
+
+drop database mysqltest;
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc
index 0fa9daa66b4..b349e3320de 100644
--- a/sql/ha_ndbcluster_binlog.cc
+++ b/sql/ha_ndbcluster_binlog.cc
@@ -20,6 +20,7 @@
#ifdef HAVE_NDB_BINLOG
#include "rpl_injector.h"
+#include "rpl_filter.h"
#include "slave.h"
#include "ha_ndbcluster_binlog.h"
@@ -2019,6 +2020,12 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab,
DBUG_RETURN(0);
}
+ if (!binlog_filter->db_ok(share->db))
+ {
+ share->flags|= NSF_NO_BINLOG;
+ DBUG_RETURN(0);
+ }
+
if (share->op)
{
assert(share->op->getCustomData() == (void *) share);