Some MariaDB users have complained that when upgrading from a MariaDB 10.1 to MariaDB 10.2+
some tables has generated wrong auto_increment values after the upgrade.
The reason is probably that the area that InnoDB uses to store auto_increment in 10.2.4 and above can in some cases contain 'not cleared data', which causes the above problem.
The intent of this task is to ensure that when upgrading from MariaDB < 10.2.4 then this area is cleared, which would mean that next generated auto_increment would be max(auto_increment_column) +1
Here follows the suggested way to do this:
Update innodb::check_for_upgrade() as follows:
if the following is true:
table->s->mysql_version < 100204 &&
table->next_number_field;
return HA_ADMIN_NEEDS_UPGRADE
else
return HA_ADMIN_OK
Returning HA_ADMIN_NEEDS_UPGRADE will cause mysqlcheck (part of mysql_upgrade) to call REPAIR and thus innodb::repair() will be called.
In innodb::repair, if the above test in check_for_upgrade() is true
clear the auto_increment area and return HA_ADMIN_OK
else
return HA_ADMIN_NOT_IMPLEMENTED.
if check_for_upgrade() or repair() returns HA_ADMIN_OK then
the current MYSQL_VERSION_ID in the .frm file will be updated
so that the above repair will never be called again for this case.
The end effect of this change would be that if one runs mysql_upgrade, then any INNODB tables created before 10.2.4 will have it's auto_increment area cleared and the next generated auto_increment value will be max(auto_increment_column) +1
Attachments
Issue Links
includes
MDEV-20357Strange auto_increment counter setting changes on direct upgrade from 10.1 to 10.3
Closed
MDEV-22167auto_increment counters changed weirdly after direct 10.1 -> 10.3 upgrade
Is this still needed? MariaDB Server 10.1 reached End of Life in October 2020. I suppose that everyone will have upgraded already.
Marko Mäkelä
added a comment - Sorry, I have not come around to this.
Is this still needed? MariaDB Server 10.1 reached End of Life in October 2020. I suppose that everyone will have upgraded already.
People
Michael Widenius
Michael Widenius
Votes:
0Vote for this issue
Watchers:
7Start 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.
{"report":{"fcp":1331.6000001430511,"ttfb":358.5,"pageVisibility":"visible","entityId":85968,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"c29d31c9-8786-4e77-8697-3069d2dfeafe","navigationType":0,"readyForUser":1362.6000001430511,"redirectCount":0,"resourceLoadedEnd":1872.7000000476837,"resourceLoadedStart":371.2000000476837,"resourceTiming":[{"duration":176.40000009536743,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":371.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":371.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":547.6000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":176.60000014305115,"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":371.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":371.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":548.1000001430511,"responseStart":0,"secureConnectionStart":0},{"duration":259.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":371.7999999523163,"connectEnd":371.7999999523163,"connectStart":371.7999999523163,"domainLookupEnd":371.7999999523163,"domainLookupStart":371.7999999523163,"fetchStart":371.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":371.7999999523163,"responseEnd":631,"responseStart":631,"secureConnectionStart":371.7999999523163},{"duration":396,"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":371.90000009536743,"connectEnd":371.90000009536743,"connectStart":371.90000009536743,"domainLookupEnd":371.90000009536743,"domainLookupStart":371.90000009536743,"fetchStart":371.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":371.90000009536743,"responseEnd":767.9000000953674,"responseStart":767.9000000953674,"secureConnectionStart":371.90000009536743},{"duration":454.09999990463257,"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":372.2000000476837,"connectEnd":372.2000000476837,"connectStart":372.2000000476837,"domainLookupEnd":372.2000000476837,"domainLookupStart":372.2000000476837,"fetchStart":372.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":372.2000000476837,"responseEnd":826.2999999523163,"responseStart":826.2999999523163,"secureConnectionStart":372.2000000476837},{"duration":485.7000000476837,"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":372.40000009536743,"connectEnd":372.40000009536743,"connectStart":372.40000009536743,"domainLookupEnd":372.40000009536743,"domainLookupStart":372.40000009536743,"fetchStart":372.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":372.40000009536743,"responseEnd":858.1000001430511,"responseStart":858.1000001430511,"secureConnectionStart":372.40000009536743},{"duration":504.5,"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":372.60000014305115,"connectEnd":372.60000014305115,"connectStart":372.60000014305115,"domainLookupEnd":372.60000014305115,"domainLookupStart":372.60000014305115,"fetchStart":372.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":372.60000014305115,"responseEnd":877.1000001430511,"responseStart":877.1000001430511,"secureConnectionStart":372.60000014305115},{"duration":538.4000000953674,"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":372.7999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":372.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":911.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":506.39999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":372.90000009536743,"connectEnd":372.90000009536743,"connectStart":372.90000009536743,"domainLookupEnd":372.90000009536743,"domainLookupStart":372.90000009536743,"fetchStart":372.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":372.90000009536743,"responseEnd":879.2999999523163,"responseStart":879.2999999523163,"secureConnectionStart":372.90000009536743},{"duration":538.5,"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":373,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":373,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":911.5,"responseStart":0,"secureConnectionStart":0},{"duration":521.7000000476837,"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":373.2000000476837,"connectEnd":373.2000000476837,"connectStart":373.2000000476837,"domainLookupEnd":373.2000000476837,"domainLookupStart":373.2000000476837,"fetchStart":373.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":373.2000000476837,"responseEnd":894.9000000953674,"responseStart":894.9000000953674,"secureConnectionStart":373.2000000476837},{"duration":1014.4000000953674,"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":374.2999999523163,"connectEnd":374.2999999523163,"connectStart":374.2999999523163,"domainLookupEnd":374.2999999523163,"domainLookupStart":374.2999999523163,"fetchStart":374.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":374.2999999523163,"responseEnd":1388.7000000476837,"responseStart":1388.7000000476837,"secureConnectionStart":374.2999999523163},{"duration":1476.2000000476837,"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":374.2999999523163,"connectEnd":374.2999999523163,"connectStart":374.2999999523163,"domainLookupEnd":374.2999999523163,"domainLookupStart":374.2999999523163,"fetchStart":374.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":374.2999999523163,"responseEnd":1850.5,"responseStart":1850.5,"secureConnectionStart":374.2999999523163},{"duration":474.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":925.4000000953674,"connectEnd":925.4000000953674,"connectStart":925.4000000953674,"domainLookupEnd":925.4000000953674,"domainLookupStart":925.4000000953674,"fetchStart":925.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":925.4000000953674,"responseEnd":1399.9000000953674,"responseStart":1399.9000000953674,"secureConnectionStart":925.4000000953674},{"duration":588.1999998092651,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1281.6000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1281.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1869.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":460.2999999523163,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1403.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1403.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1864,"responseStart":0,"secureConnectionStart":0},{"duration":458.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":1404.7000000476837,"connectEnd":1404.7000000476837,"connectStart":1404.7000000476837,"domainLookupEnd":1404.7000000476837,"domainLookupStart":1404.7000000476837,"fetchStart":1404.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":1404.7000000476837,"responseEnd":1862.7999999523163,"responseStart":1862.7999999523163,"secureConnectionStart":1404.7000000476837},{"duration":467.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":1405.5,"connectEnd":1405.5,"connectStart":1405.5,"domainLookupEnd":1405.5,"domainLookupStart":1405.5,"fetchStart":1405.5,"redirectEnd":0,"redirectStart":0,"requestStart":1405.5,"responseEnd":1872.7000000476837,"responseStart":1872.7000000476837,"secureConnectionStart":1405.5}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":207,"responseStart":358,"responseEnd":365,"domLoading":367,"domInteractive":1876,"domContentLoadedEventStart":1876,"domContentLoadedEventEnd":1920,"domComplete":2282,"loadEventStart":2282,"loadEventEnd":2283,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1852.7000000476837},{"name":"bigPipe.sidebar-id.end","time":1853.6000001430511},{"name":"bigPipe.activity-panel-pipe-id.start","time":1853.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.end","time":1854.7000000476837},{"name":"activityTabFullyLoaded","time":1934}],"measures":[],"correlationId":"776dbfcd5a9f28","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":96,"dbReadsTimeInMs":14,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Sorry, I have not come around to this.
Is this still needed? MariaDB Server 10.1 reached End of Life in October 2020. I suppose that everyone will have upgraded already.