Commit 852bac88 authored by unknown's avatar unknown

Bug #27076

 - test case


sql/ha_ndbcluster_binlog.cc:
  drop table not logged when it should
mysql-test/r/ndb_binlog_log_bin.result:
  New BitKeeper file ``mysql-test/r/ndb_binlog_log_bin.result''
mysql-test/t/ndb_binlog_log_bin.test:
  New BitKeeper file ``mysql-test/t/ndb_binlog_log_bin.test''
parent ca564999
drop table if exists t1,t2,t3;
reset master;
drop table if exists t1,t2,t3;
reset master;
set SQL_LOG_BIN=0;
create database mysqltest;
use mysqltest;
create table t1 (a int key, b int) engine=ndb;
create table t2 (a int key, b int) engine=ndb;
insert into t1 values (1,1);
alter table t1 add c int;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT
reset master;
use mysqltest;
insert into t2 values (1,1);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query 102 # BEGIN
master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t1)
master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
master-bin1.000001 # Query 102 # COMMIT
master-bin1.000001 # Query 102 # BEGIN
master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t2)
master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
master-bin1.000001 # Write_rows 102 # table_id: #
master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
master-bin1.000001 # Query 102 # COMMIT
reset master;
use mysqltest;
drop table t1;
drop table t2;
create table t1 (d int key, e int) engine=ndb;
create table t2 (d int key, e 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 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (mysqltest.t2)
master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Query 1 # use `mysqltest`; drop table t1
master-bin.000001 # Query 1 # use `mysqltest`; drop table t2
master-bin.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
master-bin.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # table_id: # (mysqltest.t1)
master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status)
master-bin.000001 # Write_rows 1 # table_id: #
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # COMMIT
use mysqltest;
insert into t2 values (1,1);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query 1 # use `mysqltest`; drop table `t1`
master-bin1.000001 # Query 1 # use `mysqltest`; drop table `t2`
master-bin1.000001 # Query 1 # use `mysqltest`; create table t1 (d int key, e int) engine=ndb
master-bin1.000001 # Query 1 # use `mysqltest`; create table t2 (d int key, e int) engine=ndb
master-bin1.000001 # Query 102 # BEGIN
master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t1)
master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
master-bin1.000001 # Write_rows 102 # table_id: #
master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
master-bin1.000001 # Query 102 # COMMIT
master-bin1.000001 # Query 102 # BEGIN
master-bin1.000001 # Table_map 102 # table_id: # (mysqltest.t2)
master-bin1.000001 # Table_map 102 # table_id: # (mysql.ndb_apply_status)
master-bin1.000001 # Write_rows 102 # table_id: #
master-bin1.000001 # Write_rows 102 # table_id: # flags: STMT_END_F
master-bin1.000001 # Query 102 # COMMIT
drop database mysqltest;
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/have_binlog_format_row.inc
--disable_warnings
connection server2;
drop table if exists t1,t2,t3;
reset master;
connection server1;
drop table if exists t1,t2,t3;
reset master;
--enable_warnings
# basic SQL_LOG_BIN functionality
# see updates from one thread but not the other
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
# do some stuff with SQL_LOG_BIN=0
connection con2;
set SQL_LOG_BIN=0;
create database mysqltest;
use mysqltest;
create table t1 (a int key, b int) engine=ndb;
create table t2 (a int key, b int) engine=ndb;
insert into t1 values (1,1);
alter table t1 add c int;
# we should not see it in the local server
-- source include/show_binlog_events.inc
reset master;
# we should not see it in another server
connection server2;
use mysqltest;
insert into t2 values (1,1);
-- source include/show_binlog_events.inc
reset master;
# but if you do stuff in "default" client setting
connection con1;
use mysqltest;
drop table t1;
drop table t2;
create table t1 (d int key, e int) engine=ndb;
create table t2 (d int key, e int) engine=ndb;
insert into t1 values (1,1);
-- source include/show_binlog_events.inc
# and in another server
connection server2;
use mysqltest;
insert into t2 values (1,1);
-- source include/show_binlog_events.inc
drop database mysqltest;
......@@ -2108,10 +2108,10 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd,
log_query= 1;
break;
case SOT_DROP_TABLE:
log_query= 1;
// invalidation already handled by binlog thread
if (share && share->op)
{
log_query= 1;
break;
}
// fall through
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment