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

improved support of replication between tables of different structure

    XMLWordPrintable

Details

    • Q4/2025 Server Maintenance

    Description

      --binlog_row_metadata=full stores columns names and other metadata into the binary log.
      However this is not used by replication threads, which can cause data loss on multi-master if one adds or drop fields with ALTER TABLE when binlog_format=row or binlog_format=statement is used.

      ALTER TABLE will work if columns are added last to the table. However if one deletes columns or add a column in the middle of the table will cause all future DML to update wrong fields.

      The fix is that if --binlog_row_metadata=full is used, we should not use field positions but instead use field names for insert and update when applying row events.
      mariadb-binlog should also be update to show fieldnames instead of field positions if field names are available.

      I will add a simple test case that one can use to verify the issue.

      We should probably also add an option --slave_type_conversions=IGNORE_MISSING_COLUMNS to allow one to drop columns with ALTER TABLE

      Attachments

        1. skr.opt
          0.1 kB
          Michael Widenius
        2. skr.test
          0.5 kB
          Michael Widenius

        Issue Links

          Activity

            People

              monty Michael Widenius
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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