Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30834

restoring a dump created by mysqldump doesn't restore table rows if the database is excluded from binary log using binlog_ignore_db option

    XMLWordPrintable

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

          Activity

            People

              marko Marko Mäkelä
              andrea.janna Andrea Janna
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.