Sprint:
10.0.25, 10.0.26, 10.0.30
When using a WHERE Clause on a View under some circumstances (View with subqueries) results in an empty result set:
Steps to reproduce:
Create dummy table
CREATE TABLE `use_case_log` (
`id` int(20) NOT NULL AUTO_INCREMENT,
`use_case` int(11) DEFAULT NULL,
`current_deadline` date DEFAULT NULL,
`ts_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=13976 DEFAULT CHARSET=latin1;
Insert dummy data:
INSERT INTO `use_case_log` VALUES (1,10,'2015-12-18','2015-08-18 08:38:16');
INSERT INTO `use_case_log` VALUES (2,20,'2015-10-18','2015-08-18 08:43:30');
Create a view:
CREATE VIEW V_OVERVIEW AS SELECT
use_case as use_case_id,
(
SELECT
deadline_sub.current_deadline
FROM
use_case_log deadline_sub
WHERE
deadline_sub.use_case = use_case_id
AND ts_create = (SELECT
MIN(ts_create)
FROM
use_case_log startdate_sub
WHERE
startdate_sub.use_case = use_case_id
)
) AS InitialDeadline
FROM
use_case_log
Query the view with a WHERE clause:
SELECT * FROM V_OVERVIEW where use_case_id = 10;
Actual Result
use_case_id
InitialDeadline
Expected Result
use_case_id
InitialDeadline
10
2015-12-18
Hints
Using no WHERE Clause at all in the Query works:
SELECT * FROM V_OVERVIEW;
use_case_id
InitialDeadline
10
2015-12-18
20
2015-10-18
When setting the VIEW Algorithm to "TEMPTABLE" it works too
In MySQL 5.5.43 the correct result is returned.
{"report":{"fcp":1399.3000001907349,"ttfb":344,"pageVisibility":"visible","entityId":52727,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"d13ea6ec-b6b2-4112-8fbc-dfd7cf666b75","navigationType":0,"readyForUser":1509.1000003814697,"redirectCount":0,"resourceLoadedEnd":2129.9000000953674,"resourceLoadedStart":361.2000002861023,"resourceTiming":[{"duration":435.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":361.2000002861023,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":361.2000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":796.7000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":435.6000003814697,"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":361.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":361.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":797.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":445.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":361.80000019073486,"connectEnd":361.80000019073486,"connectStart":361.80000019073486,"domainLookupEnd":361.80000019073486,"domainLookupStart":361.80000019073486,"fetchStart":361.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":361.80000019073486,"responseEnd":807,"responseStart":807,"secureConnectionStart":361.80000019073486},{"duration":481,"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":362,"connectEnd":362,"connectStart":362,"domainLookupEnd":362,"domainLookupStart":362,"fetchStart":362,"redirectEnd":0,"redirectStart":0,"requestStart":362,"responseEnd":843,"responseStart":843,"secureConnectionStart":362},{"duration":495.19999980926514,"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":362.30000019073486,"connectEnd":362.30000019073486,"connectStart":362.30000019073486,"domainLookupEnd":362.30000019073486,"domainLookupStart":362.30000019073486,"fetchStart":362.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":362.30000019073486,"responseEnd":857.5,"responseStart":857.5,"secureConnectionStart":362.30000019073486},{"duration":534,"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":362.5,"connectEnd":362.5,"connectStart":362.5,"domainLookupEnd":362.5,"domainLookupStart":362.5,"fetchStart":362.5,"redirectEnd":0,"redirectStart":0,"requestStart":362.5,"responseEnd":896.5,"responseStart":896.5,"secureConnectionStart":362.5},{"duration":562.9000000953674,"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":362.80000019073486,"connectEnd":362.80000019073486,"connectStart":362.80000019073486,"domainLookupEnd":362.80000019073486,"domainLookupStart":362.80000019073486,"fetchStart":362.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":362.80000019073486,"responseEnd":925.7000002861023,"responseStart":925.7000002861023,"secureConnectionStart":362.80000019073486},{"duration":690.1000003814697,"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":363,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":363,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1053.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":582.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":363.30000019073486,"connectEnd":363.30000019073486,"connectStart":363.30000019073486,"domainLookupEnd":363.30000019073486,"domainLookupStart":363.30000019073486,"fetchStart":363.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":363.30000019073486,"responseEnd":945.8000001907349,"responseStart":945.8000001907349,"secureConnectionStart":363.30000019073486},{"duration":689.7000002861023,"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":363.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":363.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1053.2000002861023,"responseStart":0,"secureConnectionStart":0},{"duration":582.8999996185303,"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":363.6000003814697,"connectEnd":363.6000003814697,"connectStart":363.6000003814697,"domainLookupEnd":363.6000003814697,"domainLookupStart":363.6000003814697,"fetchStart":363.6000003814697,"redirectEnd":0,"redirectStart":0,"requestStart":363.6000003814697,"responseEnd":946.5,"responseStart":946.4000000953674,"secureConnectionStart":363.6000003814697},{"duration":1765.1000003814697,"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":364.5,"connectEnd":364.5,"connectStart":364.5,"domainLookupEnd":364.5,"domainLookupStart":364.5,"fetchStart":364.5,"redirectEnd":0,"redirectStart":0,"requestStart":364.5,"responseEnd":2129.6000003814697,"responseStart":2129.6000003814697,"secureConnectionStart":364.5},{"duration":1765.1999998092651,"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":364.7000002861023,"connectEnd":364.7000002861023,"connectStart":364.7000002861023,"domainLookupEnd":364.7000002861023,"domainLookupStart":364.7000002861023,"fetchStart":364.7000002861023,"redirectEnd":0,"redirectStart":0,"requestStart":364.7000002861023,"responseEnd":2129.9000000953674,"responseStart":2129.9000000953674,"secureConnectionStart":364.7000002861023},{"duration":345.09999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1125.9000000953674,"connectEnd":1125.9000000953674,"connectStart":1125.9000000953674,"domainLookupEnd":1125.9000000953674,"domainLookupStart":1125.9000000953674,"fetchStart":1125.9000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":1125.9000000953674,"responseEnd":1471,"responseStart":1471,"secureConnectionStart":1125.9000000953674},{"duration":919.9000000953674,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1383.4000000953674,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1383.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":2303.300000190735,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":137,"responseStart":344,"responseEnd":349,"domLoading":353,"domInteractive":2177,"domContentLoadedEventStart":2177,"domContentLoadedEventEnd":2299,"domComplete":2978,"loadEventStart":2978,"loadEventEnd":2979,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2141.4000000953674},{"name":"bigPipe.sidebar-id.end","time":2142.300000190735},{"name":"bigPipe.activity-panel-pipe-id.start","time":2142.4000000953674},{"name":"bigPipe.activity-panel-pipe-id.end","time":2146.2000002861023},{"name":"activityTabFullyLoaded","time":2320.6000003814697}],"measures":[],"correlationId":"54c336ee4fce0","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":136,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
revision-id: ea909f28407133364d98718c6650df9763e47ebd (mariadb-10.0.30-21-gea909f2)
parent(s): f2dc04abea172e4c5d701a749902c88f4a626c2c
committer: Oleksandr Byelkin
timestamp: 2017-04-05 13:35:07 +0200
message:
MDEV-8642: WHERE Clause not applied on View - Empty result set returnedAn attempt to mark reference as dependent lead to transfering this quality to
original view field and through it to other references of this field which
can't be dependent.