Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL)
In InnoDB, an INSERT will not create an explicit lock object. Instead, the inserted record is initially implicitly locked by the transaction that wrote its trx_t::id to the hidden system column DB_TRX_ID . (Other transactions would check if DB_TRX_ID is referring to a transaction that has not been committed.)
If a record was inserted in the current transaction, it would be implicitly locked by that transaction. Only if some other transaction is requesting access to the record, the implicit lock should be converted to an explicit one, so that the waits-for graph can be constructed for detecting deadlocks and lock wait timeouts.
The bug is that currently, InnoDB would convert the implicit lock to an explicit one, even if no conflict exists. Here is an example:
--source include/have_innodb.inc
CREATE TABLE t1(id INT PRIMARY KEY , a INT , b CHAR (1), UNIQUE KEY u(a,b)) ENGINE=InnoDB;
BEGIN ;
INSERT INTO t1 VALUES (1,1, 'a' ),(2,9999, 'b' ),(3,10000, 'c' ),(4,4, 'd' );
DELETE FROM t1 WHERE a = 9999 AND b= 'b' ;
COMMIT ;
DROP TABLE t1;
In this test, there is no conflict, and the DELETE statement should not convert the implicit lock into an explicit one. But, the function lock_rec_convert_impl_to_expl_for_trx() is being invoked during the test.
{"report":{"fcp":688.1999999880791,"ttfb":177.19999998807907,"pageVisibility":"visible","entityId":68494,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"5685291b-8158-4937-a75e-103c90eea81d","navigationType":0,"readyForUser":766.8000000119209,"redirectCount":0,"resourceLoadedEnd":814.0999999642372,"resourceLoadedStart":183.30000001192093,"resourceTiming":[{"duration":7.199999988079071,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":183.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":183.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":190.5,"responseStart":0,"secureConnectionStart":0},{"duration":8.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":183.5999999642372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":183.5999999642372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":192.0999999642372,"responseStart":0,"secureConnectionStart":0},{"duration":62.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":183.69999998807907,"connectEnd":183.69999998807907,"connectStart":183.69999998807907,"domainLookupEnd":183.69999998807907,"domainLookupStart":183.69999998807907,"fetchStart":183.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":183.69999998807907,"responseEnd":246.0999999642372,"responseStart":246.0999999642372,"secureConnectionStart":183.69999998807907},{"duration":140.9000000357628,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/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":183.89999997615814,"connectEnd":183.89999997615814,"connectStart":183.89999997615814,"domainLookupEnd":183.89999997615814,"domainLookupStart":183.89999997615814,"fetchStart":183.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":183.89999997615814,"responseEnd":324.80000001192093,"responseStart":324.80000001192093,"secureConnectionStart":183.89999997615814},{"duration":144.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":184.0999999642372,"connectEnd":184.0999999642372,"connectStart":184.0999999642372,"domainLookupEnd":184.0999999642372,"domainLookupStart":184.0999999642372,"fetchStart":184.0999999642372,"redirectEnd":0,"redirectStart":0,"requestStart":184.0999999642372,"responseEnd":328.69999998807907,"responseStart":328.5999999642372,"secureConnectionStart":184.0999999642372},{"duration":144.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":184.39999997615814,"connectEnd":184.39999997615814,"connectStart":184.39999997615814,"domainLookupEnd":184.39999997615814,"domainLookupStart":184.39999997615814,"fetchStart":184.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":184.39999997615814,"responseEnd":329.0999999642372,"responseStart":329.0999999642372,"secureConnectionStart":184.39999997615814},{"duration":145.0999999642372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":184.5,"connectEnd":184.5,"connectStart":184.5,"domainLookupEnd":184.5,"domainLookupStart":184.5,"fetchStart":184.5,"redirectEnd":0,"redirectStart":0,"requestStart":184.5,"responseEnd":329.5999999642372,"responseStart":329.5999999642372,"secureConnectionStart":184.5},{"duration":200.80000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":184.69999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":184.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":385.5,"responseStart":0,"secureConnectionStart":0},{"duration":145.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":184.80000001192093,"connectEnd":184.80000001192093,"connectStart":184.80000001192093,"domainLookupEnd":184.80000001192093,"domainLookupStart":184.80000001192093,"fetchStart":184.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":184.80000001192093,"responseEnd":330.30000001192093,"responseStart":330.30000001192093,"secureConnectionStart":184.80000001192093},{"duration":200.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/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":185.0999999642372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":185.0999999642372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":385.69999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":147.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/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":185.19999998807907,"connectEnd":185.19999998807907,"connectStart":185.19999998807907,"domainLookupEnd":185.19999998807907,"domainLookupStart":185.19999998807907,"fetchStart":185.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":185.19999998807907,"responseEnd":332.80000001192093,"responseStart":332.80000001192093,"secureConnectionStart":185.19999998807907},{"duration":609.6000000238419,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":186.39999997615814,"connectEnd":186.39999997615814,"connectStart":186.39999997615814,"domainLookupEnd":186.39999997615814,"domainLookupStart":186.39999997615814,"fetchStart":186.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":186.39999997615814,"responseEnd":796,"responseStart":796,"secureConnectionStart":186.39999997615814},{"duration":611.4000000357628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":186.39999997615814,"connectEnd":186.39999997615814,"connectStart":186.39999997615814,"domainLookupEnd":186.39999997615814,"domainLookupStart":186.39999997615814,"fetchStart":186.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":186.39999997615814,"responseEnd":797.8000000119209,"responseStart":797.8000000119209,"secureConnectionStart":186.39999997615814},{"duration":399.89999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":396.69999998807907,"connectEnd":396.69999998807907,"connectStart":396.69999998807907,"domainLookupEnd":396.69999998807907,"domainLookupStart":396.69999998807907,"fetchStart":396.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":396.69999998807907,"responseEnd":796.5999999642372,"responseStart":796.5,"secureConnectionStart":396.69999998807907},{"duration":179.89999997615814,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":681.6999999880791,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":681.6999999880791,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":861.5999999642372,"responseStart":0,"secureConnectionStart":0},{"duration":4.199999988079071,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/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","startTime":809.8999999761581,"connectEnd":809.8999999761581,"connectStart":809.8999999761581,"domainLookupEnd":809.8999999761581,"domainLookupStart":809.8999999761581,"fetchStart":809.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":809.8999999761581,"responseEnd":814.0999999642372,"responseStart":814.0999999642372,"secureConnectionStart":809.8999999761581}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":3,"responseStart":177,"responseEnd":182,"domLoading":181,"domInteractive":897,"domContentLoadedEventStart":897,"domContentLoadedEventEnd":938,"domComplete":1108,"loadEventStart":1108,"loadEventEnd":1109,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":868.0999999642372},{"name":"bigPipe.sidebar-id.end","time":868.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.start","time":869.0999999642372},{"name":"bigPipe.activity-panel-pipe-id.end","time":870.5999999642372},{"name":"activityTabFullyLoaded","time":951.5}],"measures":[],"correlationId":"a80944b078e093","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":111,"dbReadsTimeInMs":23,"dbConnsTimeInMs":33,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}