Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.2(EOL) , 10.3(EOL) , 10.4(EOL) , 10.5 , 10.6 , 10.7(EOL) , 10.8(EOL) , 10.9(EOL) , 10.10(EOL)
--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.
{"report":{"fcp":766.9000000953674,"ttfb":234.60000038146973,"pageVisibility":"visible","entityId":97238,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"6656fb10-e9ed-4e79-800e-eaa732d596de","navigationType":0,"readyForUser":831.9000000953674,"redirectCount":0,"resourceLoadedEnd":338.30000019073486,"resourceLoadedStart":241.7000002861023,"resourceTiming":[{"duration":4.199999809265137,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":241.7000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":241.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":245.90000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":4.200000286102295,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":242,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":242,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":246.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":74.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":242.10000038146973,"connectEnd":242.10000038146973,"connectStart":242.10000038146973,"domainLookupEnd":242.10000038146973,"domainLookupStart":242.10000038146973,"fetchStart":242.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":249.80000019073486,"responseEnd":316.6000003814697,"responseStart":261.90000009536743,"secureConnectionStart":242.10000038146973},{"duration":96,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":242.30000019073486,"connectEnd":242.30000019073486,"connectStart":242.30000019073486,"domainLookupEnd":242.30000019073486,"domainLookupStart":242.30000019073486,"fetchStart":242.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":251.10000038146973,"responseEnd":338.30000019073486,"responseStart":273.2000002861023,"secureConnectionStart":242.30000019073486},{"duration":33.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":242.5,"connectEnd":242.5,"connectStart":242.5,"domainLookupEnd":242.5,"domainLookupStart":242.5,"fetchStart":242.5,"redirectEnd":0,"redirectStart":0,"requestStart":251.60000038146973,"responseEnd":275.80000019073486,"responseStart":275.2000002861023,"secureConnectionStart":242.5},{"duration":46.799999713897705,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":242.7000002861023,"connectEnd":242.7000002861023,"connectStart":242.7000002861023,"domainLookupEnd":242.7000002861023,"domainLookupStart":242.7000002861023,"fetchStart":242.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":252.90000009536743,"responseEnd":289.5,"responseStart":289.1000003814697,"secureConnectionStart":242.7000002861023},{"duration":46.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":242.90000009536743,"connectEnd":242.90000009536743,"connectStart":242.90000009536743,"domainLookupEnd":242.90000009536743,"domainLookupStart":242.90000009536743,"fetchStart":242.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":253.5,"responseEnd":289,"responseStart":288.40000009536743,"secureConnectionStart":242.90000009536743},{"duration":10.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":243,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":243,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":253.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":63.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":243.2000002861023,"connectEnd":243.2000002861023,"connectStart":243.2000002861023,"domainLookupEnd":243.2000002861023,"domainLookupStart":243.2000002861023,"fetchStart":243.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":256.80000019073486,"responseEnd":306.7000002861023,"responseStart":306.2000002861023,"secureConnectionStart":243.2000002861023},{"duration":11.599999904632568,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":243.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":243.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":255,"responseStart":0,"secureConnectionStart":0},{"duration":62.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":243.5,"connectEnd":243.5,"connectStart":243.5,"domainLookupEnd":243.5,"domainLookupStart":243.5,"fetchStart":243.5,"redirectEnd":0,"redirectStart":0,"requestStart":258.2000002861023,"responseEnd":306.1000003814697,"responseStart":303.90000009536743,"secureConnectionStart":243.5},{"duration":26.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":251.2000002861023,"connectEnd":262.5,"connectStart":262.5,"domainLookupEnd":262.5,"domainLookupStart":262.5,"fetchStart":251.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":262.90000009536743,"responseEnd":277.6000003814697,"responseStart":276.6000003814697,"secureConnectionStart":262.5},{"duration":23.799999713897705,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":252.60000038146973,"connectEnd":252.60000038146973,"connectStart":252.60000038146973,"domainLookupEnd":252.60000038146973,"domainLookupStart":252.60000038146973,"fetchStart":252.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":263.30000019073486,"responseEnd":276.40000009536743,"responseStart":274.6000003814697,"secureConnectionStart":252.60000038146973},{"duration":203.30000019073486,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":526.9000000953674,"connectEnd":526.9000000953674,"connectStart":526.9000000953674,"domainLookupEnd":526.9000000953674,"domainLookupStart":526.9000000953674,"fetchStart":526.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":693.2000002861023,"responseEnd":730.2000002861023,"responseStart":729.2000002861023,"secureConnectionStart":526.9000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":82,"responseStart":235,"responseEnd":253,"domLoading":238,"domInteractive":894,"domContentLoadedEventStart":894,"domContentLoadedEventEnd":937,"domComplete":1452,"loadEventStart":1452,"loadEventEnd":1453,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":865},{"name":"bigPipe.sidebar-id.end","time":865.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":865.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":867.3000001907349},{"name":"activityTabFullyLoaded","time":955.8000001907349}],"measures":[],"correlationId":"cfc05bac8fb754","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":89,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
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.