Spurious `use` statements in output from mysqlbinlog --rewrite-db="a->b"
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MariaDB |
In Progress
|
Low
|
Kristian Nielsen | |||
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.1 |
Won't Fix
|
Low
|
Unassigned | |||
5.5 |
Triaged
|
Low
|
Unassigned | |||
5.6 |
New
|
Low
|
Unassigned | |||
5.7 |
New
|
Low
|
Unassigned |
Bug 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/
-- source include/
-- source include/
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_
--exec $MYSQL_BINLOG $MYSQLD_
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.
Related branches
Changed in maria: | |
assignee: | nobody → Kristian Nielsen (knielsen) |
importance: | Undecided → Low |
milestone: | none → 5.2 |
status: | New → In Progress |
Changed in percona-server: | |
importance: | Undecided → Low |
rewrite-db has not been ported to PS 5.5 yet, marking it as triaged for 5.5.