Commit 992f8898 authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

added SHOW BINLOG EVENTS

fixed log sequence bugs
fixed bugs in handling Slave event
added test case with SHOW BINLOG EVENTS
have not fixed all the bugs - found some that are also in 3.23,
will fix them there first, then do pull and cleanup

will not push this changeset
parent 172913f5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -210,4 +210,5 @@
#define ER_READ_ONLY_TRANSACTION 1207
#define ER_CONNECT_TO_MASTER 1208
#define ER_QUERY_ON_MASTER 1209
#define ER_ERROR_MESSAGES 210
#define ER_SHOW_BINLOG_EVENTS 1210
#define ER_ERROR_MESSAGES 211
+1 −1
Original line number Diff line number Diff line
@@ -659,7 +659,7 @@ run_testcase ()
 slave_master_info_file=$TESTDIR/$tname-slave-master-info.opt
 SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0`
 if [ -n $SKIP_TEST ] ; then 
   SKIP_THIS_TEST=`$EXPR \( $tname : $SKIP_TEST \) != 0`
   SKIP_THIS_TEST=`$EXPR \( $tname : '$SKIP_TEST' \) != 0`
   if [ x$SKIP_THIS_TEST = x1 ] ;
   then
    return;
+51 −0
Original line number Diff line number Diff line
Log_name	Pos	Event_type	Server_id	Log_seq	Info
master-bin.001	4	Start	1	1	Server ver: 4.0.0-debug-log, Binlog ver: 2
master-bin.001	79	Query	1	2	use test; create table t1(n int not null auto_increment primary key)
master-bin.001	172	Intvar	1	3	INSERT_ID=1
master-bin.001	200	Query	1	4	use test; insert into t1 values (NULL)
master-bin.001	263	Query	1	5	use test; drop table t1
master-bin.001	311	Query	1	6	use test; create table t1 (word char(20) not null)
master-bin.001	386	Load	1	7	use test; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1 FIELDS TERMINATED BY '\t' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
master-bin.001	468	Query	1	8	use test; drop table t1
Log_name	Pos	Event_type	Server_id	Log_seq	Info
master-bin.001	79	Query	1	2	use test; create table t1(n int not null auto_increment primary key)
Log_name	Pos	Event_type	Server_id	Log_seq	Info
master-bin.001	79	Query	1	2	use test; create table t1(n int not null auto_increment primary key)
master-bin.001	172	Intvar	1	3	INSERT_ID=1
Log_name	Pos	Event_type	Server_id	Log_seq	Info
master-bin.001	200	Query	1	4	use test; insert into t1 values (NULL)
Log_name	Pos	Event_type	Server_id	Log_seq	Info
master-bin.001	4	Start	1	1	Server ver: 4.0.0-debug-log, Binlog ver: 2
master-bin.001	79	Query	1	2	use test; create table t1(n int not null auto_increment primary key)
master-bin.001	172	Intvar	1	3	INSERT_ID=1
master-bin.001	200	Query	1	4	use test; insert into t1 values (NULL)
master-bin.001	263	Query	1	5	use test; drop table t1
master-bin.001	311	Query	1	6	use test; create table t1 (word char(20) not null)
master-bin.001	386	Load	1	7	use test; LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1 FIELDS TERMINATED BY '\t' ESCAPED BY '\\' LINES TERMINATED BY '\n' (word)
master-bin.001	468	Query	1	8	use test; drop table t1
master-bin.001	516	Rotate	1	9	master-bin.002
master-bin.001	549	Stop	1	10	
Log_name	Pos	Event_type	Server_id	Log_seq	Info
master-bin.002	4	Start	1	1	Server ver: 4.0.0-debug-log, Binlog ver: 2
Log_name
slave-bin.001
slave-bin.002
slave-bin.003
slave-bin.004
Log_name	Pos	Event_type	Server_id	Log_seq	Info
slave-bin.001	4	Start	2	1	Server ver: 4.0.0-debug-log, Binlog ver: 2
slave-bin.001	79	Slave	2	2	
slave-bin.001	118	Rotate	2	3	slave-bin.002
slave-bin.001	150	Stop	2	4	
Log_name	Pos	Event_type	Server_id	Log_seq	Info
slave-bin.002	4	Start	2	1	Server ver: 4.0.0-debug-log, Binlog ver: 2
slave-bin.002	79	Slave	1	2	
slave-bin.002	132	Slave	1	3	
slave-bin.002	185	Query	1	4	use test; create table t1(n int not null auto_increment primary key)
slave-bin.002	278	Intvar	2	5	INSERT_ID=1
slave-bin.002	306	Query	1	6	use test; insert into t1 values (NULL)
slave-bin.002	369	Query	1	7	use test; drop table t1
slave-bin.002	417	Query	1	8	use test; create table t1 (word char(20) not null)
slave-bin.002	492	Query	1	9	use test; drop table t1
slave-bin.002	540	Rotate	2	10	slave-bin.003
slave-bin.002	572	Stop	2	11	
+27 −0
Original line number Diff line number Diff line
source include/master-slave.inc;

#clean up slave binlogs
connection slave;
reset master;

connection master;
drop table if exists t1;
create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL);
drop table t1;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
drop table t1;
show binlog events;
show binlog events from 79 limit 1;
show binlog events from 79 limit 2;
show binlog events from 79 limit 2,1;
flush logs;
show binlog events;
show binlog events in 'master-bin.002';
save_master_pos;
connection slave;
sync_with_master;
show master logs;
show binlog events in 'slave-bin.001' from 4;
show binlog events in 'slave-bin.002' from 4;
+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ static SYMBOL symbols[] = {
  { "BIGINT",		SYM(BIGINT),0,0},
  { "BIT",		SYM(BIT_SYM),0,0},
  { "BINARY",		SYM(BINARY),0,0},
  { "BINLOG",		SYM(BINLOG_SYM),0,0},
  { "BLOB",		SYM(BLOB_SYM),0,0},
  { "BOOL",		SYM(BOOL_SYM),0,0},
  { "BOTH",		SYM(BOTH),0,0},
@@ -128,6 +129,7 @@ static SYMBOL symbols[] = {
  { "ENABLE",		SYM(ENABLE_SYM),0,0},
  { "ENCLOSED",		SYM(ENCLOSED),0,0},
  { "ENUM",		SYM(ENUM),0,0},
  { "EVENTS",		SYM(EVENTS_SYM),0,0},
  { "EXPLAIN",		SYM(DESCRIBE),0,0},
  { "EXISTS",		SYM(EXISTS),0,0},
  { "EXTENDED",		SYM(EXTENDED_SYM),0,0},
Loading