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":1205.8999999761581,"ttfb":288.1999999284744,"pageVisibility":"visible","entityId":32018,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"080077c7-ed70-415f-bf02-dca40ba282e6","navigationType":0,"readyForUser":1281.1999999284744,"redirectCount":0,"resourceLoadedEnd":946,"resourceLoadedStart":294.1999999284744,"resourceTiming":[{"duration":325.10000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":294.1999999284744,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":294.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":619.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":328.2999999523163,"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":294.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":294.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":622.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":497,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":294.60000002384186,"connectEnd":294.60000002384186,"connectStart":294.60000002384186,"domainLookupEnd":294.60000002384186,"domainLookupStart":294.60000002384186,"fetchStart":294.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":624.6999999284744,"responseEnd":791.6000000238419,"responseStart":663.1999999284744,"secureConnectionStart":294.60000002384186},{"duration":651.2000000476837,"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":294.7999999523163,"connectEnd":294.7999999523163,"connectStart":294.7999999523163,"domainLookupEnd":294.7999999523163,"domainLookupStart":294.7999999523163,"fetchStart":294.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":626.7999999523163,"responseEnd":946,"responseStart":691,"secureConnectionStart":294.7999999523163},{"duration":379.10000002384186,"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":295,"connectEnd":295,"connectStart":295,"domainLookupEnd":295,"domainLookupStart":295,"fetchStart":295,"redirectEnd":0,"redirectStart":0,"requestStart":627,"responseEnd":674.1000000238419,"responseStart":671.3999999761581,"secureConnectionStart":295},{"duration":378.60000002384186,"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":295.1999999284744,"connectEnd":295.1999999284744,"connectStart":295.1999999284744,"domainLookupEnd":295.1999999284744,"domainLookupStart":295.1999999284744,"fetchStart":295.1999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":627,"responseEnd":673.7999999523163,"responseStart":670.3999999761581,"secureConnectionStart":295.1999999284744},{"duration":379,"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":295.2999999523163,"connectEnd":295.2999999523163,"connectStart":295.2999999523163,"domainLookupEnd":295.2999999523163,"domainLookupStart":295.2999999523163,"fetchStart":295.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":627.2999999523163,"responseEnd":674.2999999523163,"responseStart":671.7999999523163,"secureConnectionStart":295.2999999523163},{"duration":330.10000002384186,"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":295.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":625.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":378.8000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":295.6999999284744,"connectEnd":295.6999999284744,"connectStart":295.6999999284744,"domainLookupEnd":295.6999999284744,"domainLookupStart":295.6999999284744,"fetchStart":295.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":633,"responseEnd":674.5,"responseStart":672.2999999523163,"secureConnectionStart":295.6999999284744},{"duration":330.60000002384186,"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":295.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":295.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":626.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":379.39999997615814,"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":296,"connectEnd":296,"connectStart":296,"domainLookupEnd":296,"domainLookupStart":296,"fetchStart":296,"redirectEnd":0,"redirectStart":0,"requestStart":633.3999999761581,"responseEnd":675.3999999761581,"responseStart":672.7999999523163,"secureConnectionStart":296},{"duration":541.5,"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":301.60000002384186,"connectEnd":301.60000002384186,"connectStart":301.60000002384186,"domainLookupEnd":301.60000002384186,"domainLookupStart":301.60000002384186,"fetchStart":301.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":699,"responseEnd":843.1000000238419,"responseStart":836,"secureConnectionStart":301.60000002384186},{"duration":542.0999999046326,"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":302.10000002384186,"connectEnd":302.10000002384186,"connectStart":302.10000002384186,"domainLookupEnd":302.10000002384186,"domainLookupStart":302.10000002384186,"fetchStart":302.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":766.1000000238419,"responseEnd":844.1999999284744,"responseStart":837.8999999761581,"secureConnectionStart":302.10000002384186},{"duration":145.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":948.5,"connectEnd":948.5,"connectStart":948.5,"domainLookupEnd":948.5,"domainLookupStart":948.5,"fetchStart":948.5,"redirectEnd":0,"redirectStart":0,"requestStart":1058.3999999761581,"responseEnd":1094,"responseStart":1093.5,"secureConnectionStart":948.5}],"fetchStart":0,"domainLookupStart":73,"domainLookupEnd":87,"connectStart":87,"connectEnd":112,"secureConnectionStart":98,"requestStart":112,"responseStart":288,"responseEnd":300,"domLoading":292,"domInteractive":1368,"domContentLoadedEventStart":1368,"domContentLoadedEventEnd":1415,"domComplete":1775,"loadEventStart":1775,"loadEventEnd":1775,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1349.1000000238419},{"name":"bigPipe.sidebar-id.end","time":1349.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":1349.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1351.2999999523163},{"name":"activityTabFullyLoaded","time":1434.5}],"measures":[],"correlationId":"5f8215f7c7fd85","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":12,"dbConnsTimeInMs":22,"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.