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

ER_BINLOG_ROW_LOGGING_FAILED (1534: Writing one row to the row-based binary log failed)

Details

    Description

      --source include/have_binlog_format_row.inc
       
      SET binlog_row_image= MINIMAL;
       
      CREATE TABLE t1 (a INT NOT NULL DEFAULT 0 PRIMARY KEY);
      REPLACE INTO t1 () VALUES (),();
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 3c021485

      mysqltest: At line 6: query 'REPLACE INTO t1 () VALUES (),()' failed: 1534: Writing one row to the row-based binary log failed
      

      Reproducible on 10.1-10.6, MySQL 5.6-8.0.

      Attachments

        Activity

          elenst Elena Stepanova created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Workflow MariaDB v3 [ 119438 ] MariaDB v4 [ 142617 ]
          ralf.gebhardt Ralf Gebhardt made changes -
          Fix Version/s 10.2 [ 14601 ]
          elenst Elena Stepanova made changes -
          Fix Version/s 10.6 [ 24028 ]
          Fix Version/s 10.7 [ 24805 ]
          Fix Version/s 10.8 [ 26121 ]
          Fix Version/s 10.9 [ 26905 ]
          Affects Version/s 10.7 [ 24805 ]
          Affects Version/s 10.8 [ 26121 ]
          Affects Version/s 10.9 [ 26905 ]
          Affects Version/s 10.10 [ 27530 ]
          Elkin Andrei Elkin made changes -
          Assignee Andrei Elkin [ elkin ] Brandon Nesterenko [ JIRAUSER48702 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.7 [ 24805 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.3 [ 22126 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.8 [ 26121 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.9 [ 26905 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.4 [ 22408 ]
          knielsen Kristian Nielsen made changes -
          Assignee Brandon Nesterenko [ JIRAUSER48702 ] Kristian Nielsen [ knielsen ]
          knielsen Kristian Nielsen made changes -
          Status Open [ 1 ] In Progress [ 3 ]

          Patch: https://lists.mariadb.org/hyperkitty/list/commits@lists.mariadb.org/thread/QCTK775G3SFVGFGDZGLYSNNGSCWMTVFG/

          The direct cause of this is that the particular REPLACE INTO () VALUES (), () causes a special case where a write rows event is binlogged with a zero-length after-image. At some point in the history, the code was changed so that m_rows_buf is not allocated when not needed, but is_valid() was not updated to reflect this, so is_valid() incorrectly returns false for this write rows event. And this causes the failure when the second () is binlogged as an update rows event which ends up checking is_valid() for the prior write rows event.

          So this looks like a regression, though I did not spend the effort to research the commit history to discover exactly which version it was introduced in. There are a number of other places in the code where it explicitly handles the case that the after image can be empty like this.

          knielsen Kristian Nielsen added a comment - Patch: https://lists.mariadb.org/hyperkitty/list/commits@lists.mariadb.org/thread/QCTK775G3SFVGFGDZGLYSNNGSCWMTVFG/ The direct cause of this is that the particular REPLACE INTO () VALUES (), () causes a special case where a write rows event is binlogged with a zero-length after-image. At some point in the history, the code was changed so that m_rows_buf is not allocated when not needed, but is_valid() was not updated to reflect this, so is_valid() incorrectly returns false for this write rows event. And this causes the failure when the second () is binlogged as an update rows event which ends up checking is_valid() for the prior write rows event. So this looks like a regression, though I did not spend the effort to research the commit history to discover exactly which version it was introduced in. There are a number of other places in the code where it explicitly handles the case that the after image can be empty like this.
          knielsen Kristian Nielsen made changes -
          Fix Version/s 10.5.28 [ 29952 ]
          Fix Version/s 10.5 [ 23123 ]
          Fix Version/s 10.6 [ 24028 ]
          Priority Major [ 3 ] Critical [ 2 ]

          Nice find btw, elenst! It is quite bad that a simple REPLACE statement fails to binlog outright like this, though it is of course a rather special corner case which makes it less of a problem in practice probably.

          knielsen Kristian Nielsen added a comment - Nice find btw, elenst ! It is quite bad that a simple REPLACE statement fails to binlog outright like this, though it is of course a rather special corner case which makes it less of a problem in practice probably.

          Pushed to 10.5

          knielsen Kristian Nielsen added a comment - Pushed to 10.5
          knielsen Kristian Nielsen made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          JIraAutomate JiraAutomate made changes -
          Fix Version/s 10.6.21 [ 29953 ]
          Fix Version/s 10.11.11 [ 29954 ]
          Fix Version/s 11.4.5 [ 29956 ]
          Fix Version/s 11.7.2 [ 29914 ]

          People

            knielsen Kristian Nielsen
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.