[MDEV-578] LP:702303 - Spurious `use` statements in output from mysqlbinlog --rewrite-db="a->b" Created: 2011-01-13  Updated: 2015-02-02  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: Kristian Nielsen Assignee: Kristian Nielsen
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug702303.xml    

 Description   

This bug was introduced with the implementation of MWL#36.

Normally, mysqlbinlog suppresses output of `use` statements before statements
like BEGIN, COMMIT, SAVEPOINT, ROLLBACK, as they are not needed.

However, this suppression does not happen when the MWL#36 --rewrite-db option
affects the current database.

Test case:

– source include/have_binlog_format_statement.inc
– source include/have_log_bin.inc
– source include/have_innodb.inc
let $MYSQLD_DATADIR= `select @@datadir`;
create table t1 (a int primary key) engine=innodb;
create database test2;
RESET MASTER;
use test2;
begin;
use test;
insert into t1 values (1);
use test2;
commit;
begin;
use test;
insert into t1 values (2);
use test2;
commit;
use test;
select * from t1 order by a;
flush logs;
--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --short-form
-exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 --short-form --rewrite-db="test>foo" -rewrite-db="test2>bar"
drop database test2;
drop table t1;

The expected output is that each mysqlbinlog run should output a single `use`
statement, just before the first INSERT. However, currently, the second run
outputs extra `use` statements around the begin/commit statements.

I will commit a fix for 5.2.



 Comments   
Comment by Rasmus Johansson (Inactive) [ 2012-09-18 ]

Re: Spurious `use` statements in output from mysqlbinlog -rewrite-db="a>b"
rewrite-db has not been ported to PS 5.5 yet, marking it as triaged for 5.5.

Comment by Rasmus Johansson (Inactive) [ 2012-09-18 ]

Launchpad bug id: 702303

Comment by Rasmus Johansson (Inactive) [ 2012-10-04 ]

I believe this was fixed long time ago

Generated at Thu Feb 08 06:29:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.