From https://github.com/MariaDB/mariadb-docker/issues/527, a created table with AUTO_INCREMENT=X, after a restart, appears in SHOW CREATE TABLE as AUTO_INCREMENT=X+1 after a server restart.
confirmed present in 3e0009dc3a771e4dbf2fa4a4cf87e750453fb2eb (10.9.
confirmed not present in 864bbd4d0982e51c8ed643ed0fd2874c2425b451 (4700f2ac70f8c79f2ac1968b6b59d18716f492bf^) (the commit before MDEV-30796)
test case from @Nezisi on GH https://github.com/Nezisi/mariadb-autoinc-reproducer:
test.sql
|
-- MySQL dump 10.13 Distrib 5.7.22, for Win64 (x86_64)
|
--
|
-- Host: 127.0.0.1 Database: XY
|
-- ------------------------------------------------------
|
-- Server version 5.7.25
|
|
SET foreign_key_checks=0;
|
SET time_zone='+00:00';
|
SET unique_checks=0;
|
SET sql_mode='NO_AUTO_VALUE_ON_ZERO';
|
|
--
|
-- Table structure for table `pcfeature`
|
--
|
DROP TABLE IF EXISTS `pcfeature`;
|
CREATE TABLE `pcfeature` (
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
PRIMARY KEY (`id`)
|
) ENGINE=InnoDB AUTO_INCREMENT=62;
|
--
|
-- Dumping data for table `pcfeature`
|
--
|
LOCK TABLES `pcfeature` WRITE;
|
INSERT INTO `pcfeature` VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26),(27),(28),(29),(30),(31),(32),(33),(34),(35),(36),(37),(38),(39),(40),(41),(42),(43),(44),(45),(46),(47),(48),(49),(50),(51),(52),(53),(54),(55),(56),(57),(58),(59),(60),(61);
|
UNLOCK TABLES;
|
|
SET foreign_key_checks=1;
|
SET unique_checks=1;
|
-- Dump completed on 2020-10-20 11:38:49
|
mariadb test < test.sql
|
mariadb test -e 'show create table pcfeature; shutdown;
|
# shows AUTO_INCREMENT=62 per SQL
|
# restart mariadbd
|
mariadb test -e 'show create table pcfeature; shutdown;
|
# shows AUTO_INCREMENT=63
|
- is caused by
-
MDEV-30796
Auto_increment values changed after restart
-
-
Closed
{"report":{"fcp":884.5,"ttfb":260.59999990463257,"pageVisibility":"visible","entityId":124503,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"2af8288a-b014-45bb-9f98-c9dcfb5800d3","navigationType":0,"readyForUser":1008.5,"redirectCount":0,"resourceLoadedEnd":1180.1999998092651,"resourceLoadedStart":266.3999996185303,"resourceTiming":[{"duration":42.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":266.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":308.5,"responseStart":0,"secureConnectionStart":0},{"duration":42.80000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":266.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":266.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":309.5,"responseStart":0,"secureConnectionStart":0},{"duration":111.60000038146973,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":266.8999996185303,"connectEnd":266.8999996185303,"connectStart":266.8999996185303,"domainLookupEnd":266.8999996185303,"domainLookupStart":266.8999996185303,"fetchStart":266.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":266.8999996185303,"responseEnd":378.5,"responseStart":378.5,"secureConnectionStart":266.8999996185303},{"duration":189.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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","startTime":267,"connectEnd":267,"connectStart":267,"domainLookupEnd":267,"domainLookupStart":267,"fetchStart":267,"redirectEnd":0,"redirectStart":0,"requestStart":267,"responseEnd":456.69999980926514,"responseStart":456.69999980926514,"secureConnectionStart":267},{"duration":194.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":267.19999980926514,"connectEnd":267.19999980926514,"connectStart":267.19999980926514,"domainLookupEnd":267.19999980926514,"domainLookupStart":267.19999980926514,"fetchStart":267.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":267.19999980926514,"responseEnd":461.2999997138977,"responseStart":461.2999997138977,"secureConnectionStart":267.19999980926514},{"duration":194.19999980926514,"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":267.5,"connectEnd":267.5,"connectStart":267.5,"domainLookupEnd":267.5,"domainLookupStart":267.5,"fetchStart":267.5,"redirectEnd":0,"redirectStart":0,"requestStart":267.5,"responseEnd":461.69999980926514,"responseStart":461.69999980926514,"secureConnectionStart":267.5},{"duration":194.30000019073486,"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":267.8999996185303,"connectEnd":267.8999996185303,"connectStart":267.8999996185303,"domainLookupEnd":267.8999996185303,"domainLookupStart":267.8999996185303,"fetchStart":267.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":267.8999996185303,"responseEnd":462.19999980926514,"responseStart":462.09999990463257,"secureConnectionStart":267.8999996185303},{"duration":256.2999997138977,"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":268,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":524.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":194.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":268.19999980926514,"connectEnd":268.19999980926514,"connectStart":268.19999980926514,"domainLookupEnd":268.19999980926514,"domainLookupStart":268.19999980926514,"fetchStart":268.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":268.19999980926514,"responseEnd":462.69999980926514,"responseStart":462.69999980926514,"secureConnectionStart":268.19999980926514},{"duration":256,"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":268.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":268.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":524.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":194.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":268.59999990463257,"connectEnd":268.59999990463257,"connectStart":268.59999990463257,"domainLookupEnd":268.59999990463257,"domainLookupStart":268.59999990463257,"fetchStart":268.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":268.59999990463257,"responseEnd":463.2999997138977,"responseStart":463.2999997138977,"secureConnectionStart":268.59999990463257},{"duration":909.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":269.5,"connectEnd":269.5,"connectStart":269.5,"domainLookupEnd":269.5,"domainLookupStart":269.5,"fetchStart":269.5,"redirectEnd":0,"redirectStart":0,"requestStart":269.5,"responseEnd":1179,"responseStart":1179,"secureConnectionStart":269.5},{"duration":909.8999996185303,"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":269.5,"connectEnd":269.5,"connectStart":269.5,"domainLookupEnd":269.5,"domainLookupStart":269.5,"fetchStart":269.5,"redirectEnd":0,"redirectStart":0,"requestStart":269.5,"responseEnd":1179.3999996185303,"responseStart":1179.3999996185303,"secureConnectionStart":269.5},{"duration":86.90000009536743,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":540.2999997138977,"connectEnd":540.2999997138977,"connectStart":540.2999997138977,"domainLookupEnd":540.2999997138977,"domainLookupStart":540.2999997138977,"fetchStart":540.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":540.2999997138977,"responseEnd":627.1999998092651,"responseStart":627.0999999046326,"secureConnectionStart":540.2999997138977},{"duration":368.30000019073486,"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","startTime":811.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":811.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1180.1999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":62,"responseStart":260,"responseEnd":263,"domLoading":264,"domInteractive":1204,"domContentLoadedEventStart":1204,"domContentLoadedEventEnd":1249,"domComplete":1656,"loadEventStart":1656,"loadEventEnd":1657,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1184.5},{"name":"bigPipe.sidebar-id.end","time":1185.2999997138977},{"name":"bigPipe.activity-panel-pipe-id.start","time":1185.3999996185303},{"name":"bigPipe.activity-panel-pipe-id.end","time":1186.1999998092651},{"name":"activityTabFullyLoaded","time":1264.5999999046326}],"measures":[],"correlationId":"f23375815f975b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":137,"dbReadsTimeInMs":16,"dbConnsTimeInMs":34,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Can we do this in a way that the result of the test of
MDEV-30796does not fail? The expected value currently is being incremented by one after restart within the test.