Details
Description
If binary logging is enabled but a specific database is excluded from the binary log by binlog_ignore_db option, then restoring a mysqldump to that specific database doesn't restore table rows although no error is reported.
Affected MariaDB version: 10.11.2
I also tested MariaDB version 10.5.18 which is not affected by this bug.
— Steps to reproduce the issue —
Execute the server with the following options:
log_bin=/var/log/mysql/mysql-bin.log
binlog_ignore_db=database1
Execute the following SQL commands:
CREATE DATABASE `database1`;
CREATE DATABASE `database2`;
use database1;
CREATE TABLE `table1` (`column1` text NOT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
INSERT INTO `table1` VALUES ('hello world');
Execute from the shell:
mysqldump database1 > database.sql
mysql database1 < database.sql
mysql database2 < database.sql
— Expected result —
database1 table1 and database2 table1 contain one row.
— Actual result —
database1 table1 is empty.
database2 table2 contains one row.
— Workaround —
In the sql commands generated by mysqldump replace
UNIQUE_CHECKS=0
with
UNIQUE_CHECKS=1
Attachments
Issue Links
- duplicates
-
MDEV-29989 binlog_do_db option breaks importing sql dumps
- Closed