Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
10.0.8 , 10.4(EOL) , 10.5 , 10.6 , 10.11 , 11.0(EOL) , 11.1(EOL) , 11.2(EOL) , 11.3(EOL) , 11.4
In the provided test case, before I run INSERT, I execute a seemingly harmless, albeit useless, ALTER on a non-existent table, which expectedly fails with ER_NO_SUCH_TABLE.
But after that, the next INSERT on the existing table fails with ER_WRONG_PARTITION_NAME. It is expected to fail, but without the previous unrelated ALTER it fails with ER_NO_PARTITION_FOR_GIVEN_VALUE.
It wouldn't be so bad, but the whole sequence is executed on a master, the failed ALTER isn't written to the binary log, but INSERT might be, for example if it's run on a non-transactional table. In this case INSERT is written with ER_WRONG_PARTITION_NAME, but on a slave it causes ER_NO_PARTITION_FOR_GIVEN_VALUE, and this discrepancy causes replication failure.
--source include/have_partition.inc
--source include/master-slave.inc
--source include/have_binlog_format_statement.inc
CREATE TABLE IF NOT EXISTS t1 (a INT )
ENGINE=MyISAM
PARTITION BY LIST(a) (
PARTITION p0 VALUES IN (9, NULL ),
PARTITION p1 VALUES IN (8, 2, 7),
PARTITION p2 VALUES IN (6, 4, 5),
PARTITION p3 VALUES IN (3, 1, 0)
);
ALTER TABLE t1 DROP PARTITION p0;
####### Game changer
--error ER_NO_SUCH_TABLE
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2;
#######
--error ER_NO_PARTITION_FOR_GIVEN_VALUE,ER_WRONG_PARTITION_NAME
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9);
SHOW WARNINGS;
--sync_slave_with_master
140305 23:11:27 [ERROR] Slave SQL: Query caused different errors on master and slave. Error on master: message (format)='Incorrect partition name' error code=1567 ; Error on slave: actual message='Table has no partition for value 9', error code=1526. Default database: 'test'. Query: 'INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9)', Internal MariaDB error code: 0
140305 23:11:27 [ERROR] Slave SQL: Table has no partition for value 9, Internal MariaDB error code: 1526
{"report":{"fcp":962.5999999046326,"ttfb":203.09999990463257,"pageVisibility":"visible","entityId":32018,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"ff7edf46-1464-421d-8c24-7a3f0e62fb1f","navigationType":0,"readyForUser":1052.1999998092651,"redirectCount":0,"resourceLoadedEnd":1064.6999998092651,"resourceLoadedStart":208.19999980926514,"resourceTiming":[{"duration":212.90000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":208.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":421.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":213,"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":208.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":208.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":421.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":222.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":208.69999980926514,"connectEnd":208.69999980926514,"connectStart":208.69999980926514,"domainLookupEnd":208.69999980926514,"domainLookupStart":208.69999980926514,"fetchStart":208.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":208.69999980926514,"responseEnd":430.7999997138977,"responseStart":430.7999997138977,"secureConnectionStart":208.69999980926514},{"duration":312.69999980926514,"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":208.90000009536743,"connectEnd":208.90000009536743,"connectStart":208.90000009536743,"domainLookupEnd":208.90000009536743,"domainLookupStart":208.90000009536743,"fetchStart":208.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":208.90000009536743,"responseEnd":521.5999999046326,"responseStart":521.5999999046326,"secureConnectionStart":208.90000009536743},{"duration":317,"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":209,"connectEnd":209,"connectStart":209,"domainLookupEnd":209,"domainLookupStart":209,"fetchStart":209,"redirectEnd":0,"redirectStart":0,"requestStart":209,"responseEnd":526,"responseStart":526,"secureConnectionStart":209},{"duration":317.2000002861023,"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":209.2999997138977,"connectEnd":209.2999997138977,"connectStart":209.2999997138977,"domainLookupEnd":209.2999997138977,"domainLookupStart":209.2999997138977,"fetchStart":209.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":209.2999997138977,"responseEnd":526.5,"responseStart":526.5,"secureConnectionStart":209.2999997138977},{"duration":317.2999997138977,"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":209.5,"connectEnd":209.5,"connectStart":209.5,"domainLookupEnd":209.5,"domainLookupStart":209.5,"fetchStart":209.5,"redirectEnd":0,"redirectStart":0,"requestStart":209.5,"responseEnd":526.7999997138977,"responseStart":526.7999997138977,"secureConnectionStart":209.5},{"duration":365.80000019073486,"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":209.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":209.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":575.4000000953674,"responseStart":0,"secureConnectionStart":0},{"duration":317.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":209.7999997138977,"connectEnd":209.7999997138977,"connectStart":209.7999997138977,"domainLookupEnd":209.7999997138977,"domainLookupStart":209.7999997138977,"fetchStart":209.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":209.7999997138977,"responseEnd":527.1999998092651,"responseStart":527.1999998092651,"secureConnectionStart":209.7999997138977},{"duration":365.69999980926514,"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":209.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":209.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":575.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":317.69999980926514,"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":210.09999990463257,"connectEnd":210.09999990463257,"connectStart":210.09999990463257,"domainLookupEnd":210.09999990463257,"domainLookupStart":210.09999990463257,"fetchStart":210.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":210.09999990463257,"responseEnd":527.7999997138977,"responseStart":527.7999997138977,"secureConnectionStart":210.09999990463257},{"duration":542.2999997138977,"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":215.90000009536743,"connectEnd":215.90000009536743,"connectStart":215.90000009536743,"domainLookupEnd":215.90000009536743,"domainLookupStart":215.90000009536743,"fetchStart":215.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":215.90000009536743,"responseEnd":758.1999998092651,"responseStart":758.1999998092651,"secureConnectionStart":215.90000009536743},{"duration":848.5,"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":216.19999980926514,"connectEnd":216.19999980926514,"connectStart":216.19999980926514,"domainLookupEnd":216.19999980926514,"domainLookupStart":216.19999980926514,"fetchStart":216.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":216.19999980926514,"responseEnd":1064.6999998092651,"responseStart":1064.5999999046326,"secureConnectionStart":216.19999980926514},{"duration":171.19999980926514,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":587.4000000953674,"connectEnd":587.4000000953674,"connectStart":587.4000000953674,"domainLookupEnd":587.4000000953674,"domainLookupStart":587.4000000953674,"fetchStart":587.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":587.4000000953674,"responseEnd":758.5999999046326,"responseStart":758.5999999046326,"secureConnectionStart":587.4000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":37,"responseStart":203,"responseEnd":216,"domLoading":206,"domInteractive":1115,"domContentLoadedEventStart":1115,"domContentLoadedEventEnd":1160,"domComplete":1615,"loadEventStart":1615,"loadEventEnd":1616,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1101},{"name":"bigPipe.sidebar-id.end","time":1101.9000000953674},{"name":"bigPipe.activity-panel-pipe-id.start","time":1102},{"name":"bigPipe.activity-panel-pipe-id.end","time":1103.5999999046326},{"name":"activityTabFullyLoaded","time":1183.4000000953674}],"measures":[],"correlationId":"a40bef386702e1","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":99,"dbReadsTimeInMs":10,"dbConnsTimeInMs":18,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Still reproducible on all existing versions.
I can't say whether it's reproducible on MySQL 8.x, as it refuses to create a partitioned MyISAM table in the provided test case.
Please also note the strangely looking error text (the "(format)" part):
Error on master: message (format)='Incorrect partition name'
Not sure whether it's a typo or it's trying to say something which I don't understand.