-
Bug
-
-
Critical
-
Resolution:
Fixed
-
10.2.6, 5.5.65, 10.0(EOL), 10.1(EOL), 10.2(EOL)
-
-
-
-
Windows 10 Pro, latest Version
Sorry, but I'm not sure if it's a bug ... but I think so:
CREATE TABLE `tab1` (
|
`Id` int(11) NOT NULL,
|
PRIMARY KEY (`Id`)
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
INSERT INTO `tab1` (`Id`) VALUES (1);
|
|
CREATE TABLE `tab2` (
|
`tab1_Id` int(11) NOT NULL DEFAULT 0,
|
`col1` int(11) DEFAULT NULL,
|
UNIQUE KEY `col1` (`col1`)
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
INSERT INTO `tab2` (`tab1_Id`, `col1`) VALUES (1, NULL), (1, NULL);
|
Now two Statements:
SELECT Id FROM tab1 WHERE EXISTS
|
(SELECT 1 AS `C1` FROM tab2 WHERE tab1.Id = tab2.tab1_Id AND tab2.col1 IS NULL);
|
SELECT Id FROM tab1 WHERE EXISTS
|
(SELECT 1 AS `C1` FROM tab2 WHERE tab1.Id = tab2.tab1_Id);
|
Statement 1 gets a result with 2 identical rows, Statement 2 gets a result with (the correct, I mean) 1 row.
If I delete the UNIQUE Key on tab2:
ALTER TABLE `tab2` DROP INDEX `col1`;
|
both Statements gets a result with only 1 row. Why does the UNIQUE Key have such a effect? It's a bug?
{"report":{"fcp":760.7000007629395,"ttfb":216,"pageVisibility":"visible","entityId":61926,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"a23de94a-67c7-484e-8c64-43703af8764c","navigationType":0,"readyForUser":837.6000003814697,"redirectCount":0,"resourceLoadedEnd":1191.5,"resourceLoadedStart":230.80000019073486,"resourceTiming":[{"duration":64.10000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":230.80000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":230.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":294.9000005722046,"responseStart":0,"secureConnectionStart":0},{"duration":63.89999961853027,"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":231.20000076293945,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":231.20000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":295.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":80.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":231.30000019073486,"connectEnd":231.30000019073486,"connectStart":231.30000019073486,"domainLookupEnd":231.30000019073486,"domainLookupStart":231.30000019073486,"fetchStart":231.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":231.30000019073486,"responseEnd":311.5,"responseStart":311.5,"secureConnectionStart":231.30000019073486},{"duration":147.30000019073486,"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":231.5,"connectEnd":231.5,"connectStart":231.5,"domainLookupEnd":231.5,"domainLookupStart":231.5,"fetchStart":231.5,"redirectEnd":0,"redirectStart":0,"requestStart":231.5,"responseEnd":378.80000019073486,"responseStart":378.80000019073486,"secureConnectionStart":231.5},{"duration":151,"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":231.60000038146973,"connectEnd":231.60000038146973,"connectStart":231.60000038146973,"domainLookupEnd":231.60000038146973,"domainLookupStart":231.60000038146973,"fetchStart":231.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":231.60000038146973,"responseEnd":382.6000003814697,"responseStart":382.6000003814697,"secureConnectionStart":231.60000038146973},{"duration":150.9000005722046,"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":232,"connectEnd":232,"connectStart":232,"domainLookupEnd":232,"domainLookupStart":232,"fetchStart":232,"redirectEnd":0,"redirectStart":0,"requestStart":232,"responseEnd":382.9000005722046,"responseStart":382.9000005722046,"secureConnectionStart":232},{"duration":151.19999980926514,"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":232.10000038146973,"connectEnd":232.10000038146973,"connectStart":232.10000038146973,"domainLookupEnd":232.10000038146973,"domainLookupStart":232.10000038146973,"fetchStart":232.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":232.10000038146973,"responseEnd":383.30000019073486,"responseStart":383.30000019073486,"secureConnectionStart":232.10000038146973},{"duration":221,"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":232.30000019073486,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":232.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":453.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":151.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":232.5,"connectEnd":232.5,"connectStart":232.5,"domainLookupEnd":232.5,"domainLookupStart":232.5,"fetchStart":232.5,"redirectEnd":0,"redirectStart":0,"requestStart":232.5,"responseEnd":383.80000019073486,"responseStart":383.80000019073486,"secureConnectionStart":232.5},{"duration":220.89999961853027,"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":232.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":232.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":453.5,"responseStart":0,"secureConnectionStart":0},{"duration":151.69999980926514,"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":232.70000076293945,"connectEnd":232.70000076293945,"connectStart":232.70000076293945,"domainLookupEnd":232.70000076293945,"domainLookupStart":232.70000076293945,"fetchStart":232.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":232.70000076293945,"responseEnd":384.4000005722046,"responseStart":384.4000005722046,"secureConnectionStart":232.70000076293945},{"duration":789.3999996185303,"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":233.60000038146973,"connectEnd":233.60000038146973,"connectStart":233.60000038146973,"domainLookupEnd":233.60000038146973,"domainLookupStart":233.60000038146973,"fetchStart":233.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":233.60000038146973,"responseEnd":1023,"responseStart":1023,"secureConnectionStart":233.60000038146973},{"duration":957.7999992370605,"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":233.70000076293945,"connectEnd":233.70000076293945,"connectStart":233.70000076293945,"domainLookupEnd":233.70000076293945,"domainLookupStart":233.70000076293945,"fetchStart":233.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":233.70000076293945,"responseEnd":1191.5,"responseStart":1191.5,"secureConnectionStart":233.70000076293945},{"duration":569.0999994277954,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":464.70000076293945,"connectEnd":464.70000076293945,"connectStart":464.70000076293945,"domainLookupEnd":464.70000076293945,"domainLookupStart":464.70000076293945,"fetchStart":464.70000076293945,"redirectEnd":0,"redirectStart":0,"requestStart":464.70000076293945,"responseEnd":1033.8000001907349,"responseStart":1033.8000001907349,"secureConnectionStart":464.70000076293945},{"duration":439.3999996185303,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":754.7000007629395,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":754.7000007629395,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1194.1000003814697,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":60,"responseStart":216,"responseEnd":219,"domLoading":228,"domInteractive":1211,"domContentLoadedEventStart":1211,"domContentLoadedEventEnd":1251,"domComplete":2015,"loadEventStart":2015,"loadEventEnd":2017,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1195.1000003814697},{"name":"bigPipe.sidebar-id.end","time":1195.9000005722046},{"name":"bigPipe.activity-panel-pipe-id.start","time":1196.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.end","time":1198.5},{"name":"activityTabFullyLoaded","time":1257.3000001907349}],"measures":[],"correlationId":"6c7fd5bcf97b42","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":97,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}