Type:
Bug
Priority:
Minor
Resolution:
Fixed
Affects Version/s:
10.6
CREATE SEQUENCE and
CREATE TEMPORARY SEQUENCE
causes implicit commit to happen. This is not documented, and possibly the intention was not trigger implicit committing. To reproduce, try e.g.:
MariaDB [test]> create table t1 (i int primary key) engine=innodb;
Query OK, 0 rows affected ( 0 , 062 sec)
MariaDB [test]> begin;
Query OK, 0 rows affected ( 0 , 004 sec)
MariaDB [test]> insert into t1 values ( 1 );
Query OK, 1 row affected ( 0 , 042 sec)
MariaDB [test]> create sequence s1 NOCACHE engine=innodb;
Query OK, 0 rows affected ( 0 , 069 sec)
MariaDB [test]> rollback;
Query OK, 0 rows affected ( 0 , 003 sec)
MariaDB [test]> select * from t1;
+---+
| i |
+---+
| 1 |
+---+
Same happens if the sequence is created like:
create temporary sequence s1 NOCACHE engine=innodb;
DBUG traces show that for "create sequence" execution, in mysql_execute_command() the test for implicit commit is carried out by: stmt_causes_implicit_commit(), which returns true and the implicit commit follows. So it looks like the implicit commit was done on purpose for this case. But then, "create sequence" statement should be added to the list of statements causing implicit commit.
otoh, for "create temporary sequence", the stmt_causes_implicit_commit() returns false, and implicit commit is skipped in mysql_execute_command(). However, in later execution traces show that:
T @19 : | | | | | | >sequence_insert
T @19 : | | | | | | | >handler::ha_write_row
T @19 : | | | | | | | | >ha_sequence::write_row
T @19 : | | | | | | | | | >ha_innobase::write_row
T @19 : | | | | | | | >trans_commit_implicit
In sequence_insert() implicit commit is called unconditionally. This looks like a bug.
{"report":{"fcp":801.0999999940395,"ttfb":156,"pageVisibility":"visible","entityId":122516,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"8c7b31ca-a1cf-44e9-8a91-dc5e1cd0f820","navigationType":0,"readyForUser":873.6999999880791,"redirectCount":0,"resourceLoadedEnd":620.8999999910593,"resourceLoadedStart":165.19999998807907,"resourceTiming":[{"duration":111.90000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":165.19999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":277.09999999403954,"responseStart":0,"secureConnectionStart":0},{"duration":181.70000000298023,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":165.3999999910593,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":165.3999999910593,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":347.09999999403954,"responseStart":0,"secureConnectionStart":0},{"duration":190.59999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":165.59999999403954,"connectEnd":165.59999999403954,"connectStart":165.59999999403954,"domainLookupEnd":165.59999999403954,"domainLookupStart":165.59999999403954,"fetchStart":165.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":165.59999999403954,"responseEnd":356.19999998807907,"responseStart":356.19999998807907,"secureConnectionStart":165.59999999403954},{"duration":252.3999999910593,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":165.79999999701977,"connectEnd":165.79999999701977,"connectStart":165.79999999701977,"domainLookupEnd":165.79999999701977,"domainLookupStart":165.79999999701977,"fetchStart":165.79999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":165.79999999701977,"responseEnd":418.19999998807907,"responseStart":418.19999998807907,"secureConnectionStart":165.79999999701977},{"duration":255.6000000089407,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":165.8999999910593,"connectEnd":165.8999999910593,"connectStart":165.8999999910593,"domainLookupEnd":165.8999999910593,"domainLookupStart":165.8999999910593,"fetchStart":165.8999999910593,"redirectEnd":0,"redirectStart":0,"requestStart":165.8999999910593,"responseEnd":421.5,"responseStart":421.5,"secureConnectionStart":165.8999999910593},{"duration":255.90000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":166.09999999403954,"connectEnd":166.09999999403954,"connectStart":166.09999999403954,"domainLookupEnd":166.09999999403954,"domainLookupStart":166.09999999403954,"fetchStart":166.09999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":166.09999999403954,"responseEnd":422,"responseStart":422,"secureConnectionStart":166.09999999403954},{"duration":256,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":166.29999999701977,"connectEnd":166.29999999701977,"connectStart":166.29999999701977,"domainLookupEnd":166.29999999701977,"domainLookupStart":166.29999999701977,"fetchStart":166.29999999701977,"redirectEnd":0,"redirectStart":0,"requestStart":166.29999999701977,"responseEnd":422.29999999701977,"responseStart":422.29999999701977,"secureConnectionStart":166.29999999701977},{"duration":327.90000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":166.3999999910593,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.3999999910593,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":494.29999999701977,"responseStart":0,"secureConnectionStart":0},{"duration":256.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":166.59999999403954,"connectEnd":166.59999999403954,"connectStart":166.59999999403954,"domainLookupEnd":166.59999999403954,"domainLookupStart":166.59999999403954,"fetchStart":166.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":166.59999999403954,"responseEnd":422.69999998807907,"responseStart":422.69999998807907,"secureConnectionStart":166.59999999403954},{"duration":327.80000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":166.69999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":166.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":494.5,"responseStart":0,"secureConnectionStart":0},{"duration":256.29999999701977,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":166.8999999910593,"connectEnd":166.8999999910593,"connectStart":166.8999999910593,"domainLookupEnd":166.8999999910593,"domainLookupStart":166.8999999910593,"fetchStart":166.8999999910593,"redirectEnd":0,"redirectStart":0,"requestStart":166.8999999910593,"responseEnd":423.19999998807907,"responseStart":423.19999998807907,"secureConnectionStart":166.8999999910593},{"duration":338.09999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":167.59999999403954,"connectEnd":167.59999999403954,"connectStart":167.59999999403954,"domainLookupEnd":167.59999999403954,"domainLookupStart":167.59999999403954,"fetchStart":167.59999999403954,"redirectEnd":0,"redirectStart":0,"requestStart":167.59999999403954,"responseEnd":505.69999998807907,"responseStart":505.69999998807907,"secureConnectionStart":167.59999999403954},{"duration":453.20000000298023,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":167.69999998807907,"connectEnd":167.69999998807907,"connectStart":167.69999998807907,"domainLookupEnd":167.69999998807907,"domainLookupStart":167.69999998807907,"fetchStart":167.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":167.69999998807907,"responseEnd":620.8999999910593,"responseStart":620.8999999910593,"secureConnectionStart":167.69999998807907},{"duration":100.29999999701977,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":521,"connectEnd":521,"connectStart":521,"domainLookupEnd":521,"domainLookupStart":521,"fetchStart":521,"redirectEnd":0,"redirectStart":0,"requestStart":521,"responseEnd":621.2999999970198,"responseStart":621.2999999970198,"secureConnectionStart":521}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":7,"responseStart":156,"responseEnd":161,"domLoading":163,"domInteractive":924,"domContentLoadedEventStart":924,"domContentLoadedEventEnd":970,"domComplete":1715,"loadEventStart":1715,"loadEventEnd":1717,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":907.1999999880791},{"name":"bigPipe.sidebar-id.end","time":907.7999999970198},{"name":"bigPipe.activity-panel-pipe-id.start","time":908},{"name":"bigPipe.activity-panel-pipe-id.end","time":910.2999999970198},{"name":"activityTabFullyLoaded","time":975.6999999880791}],"measures":[],"correlationId":"a8c2c7a420b0ed","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":87,"dbReadsTimeInMs":8,"dbConnsTimeInMs":15,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}