|
DROP TABLE IF EXISTS t1;
|
|
SELECT CAST('0000-00-00 00:00:00' as datetime) is null;
|
CREATE TABLE t1 (d1 datetime NOT NULL);
|
INSERT INTO t1 VALUES ('0000-00-00 00:00:00'), ('0000-00-00 00:00:00'), ('1979-09-03 20:49:36');
|
|
SET SESSION optimizer_switch='derived_merge=off';
|
SELECT count(*) FROM ( SELECT * FROM t1 ) AS a1 WHERE d1 IS NULL ; ## result 2, expected result 2
|
SET SESSION optimizer_switch='derived_merge=on';
|
SELECT count(*) FROM ( SELECT * FROM t1 ) AS a1 WHERE d1 IS NULL ; ## result 0, expected result 2
|
DROP TABLE t1;
|
|
MariaDB [test]> SELECT CAST('0000-00-00 00:00:00' as datetime) is null;
|
+-------------------------------------------------+
|
| CAST('0000-00-00 00:00:00' as datetime) is null |
|
+-------------------------------------------------+
|
| 0 |
|
+-------------------------------------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> CREATE TABLE t1 (d1 datetime NOT NULL);
|
Query OK, 0 rows affected (0.13 sec)
|
|
MariaDB [test]> INSERT INTO t1 VALUES ('0000-00-00 00:00:00'), ('0000-00-00 00:00:00'), ('1979-09-03 20:49:36');
|
Query OK, 3 rows affected (0.03 sec)
|
Records: 3 Duplicates: 0 Warnings: 0
|
|
MariaDB [test]> SET SESSION optimizer_switch='derived_merge=off';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> SELECT count(*) FROM ( SELECT * FROM t1 ) AS a1 WHERE d1 IS NULL ;
|
+----------+
|
| count(*) |
|
+----------+
|
| 2 |
|
+----------+
|
1 row in set (0.00 sec)
|
|
MariaDB [test]> SET SESSION optimizer_switch='derived_merge=on';
|
Query OK, 0 rows affected (0.00 sec)
|
|
MariaDB [test]> SELECT count(*) FROM ( SELECT * FROM t1 ) AS a1 WHERE d1 IS NULL ;
|
+----------+
|
| count(*) |
|
+----------+
|
| 0 |
|
+----------+
|
1 row in set (0.00 sec)
|
- relates to
-
MDEV-4962
Wrong result (missing rows) on LEFT JOINs and <non-nullable datetime field> IS NULL
-
-
Closed
{"report":{"fcp":855.9000000953674,"ttfb":186.5,"pageVisibility":"visible","entityId":65201,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"ef634de4-2e1f-422f-9ab5-8ee3449d0dd1","navigationType":0,"readyForUser":943.9000000953674,"redirectCount":0,"resourceLoadedEnd":999.1000001430511,"resourceLoadedStart":192.29999995231628,"resourceTiming":[{"duration":147.10000014305115,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":192.29999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":192.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":339.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":147.19999980926514,"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":192.60000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":192.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":339.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":156.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":192.79999995231628,"connectEnd":192.79999995231628,"connectStart":192.79999995231628,"domainLookupEnd":192.79999995231628,"domainLookupStart":192.79999995231628,"fetchStart":192.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":192.79999995231628,"responseEnd":349,"responseStart":349,"secureConnectionStart":192.79999995231628},{"duration":214.20000004768372,"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":193,"connectEnd":193,"connectStart":193,"domainLookupEnd":193,"domainLookupStart":193,"fetchStart":193,"redirectEnd":0,"redirectStart":0,"requestStart":193,"responseEnd":407.2000000476837,"responseStart":407.2000000476837,"secureConnectionStart":193},{"duration":218.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":193.20000004768372,"connectEnd":193.20000004768372,"connectStart":193.20000004768372,"domainLookupEnd":193.20000004768372,"domainLookupStart":193.20000004768372,"fetchStart":193.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":193.20000004768372,"responseEnd":411.2999999523163,"responseStart":411.2999999523163,"secureConnectionStart":193.20000004768372},{"duration":218.5,"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":193.29999995231628,"connectEnd":193.29999995231628,"connectStart":193.29999995231628,"domainLookupEnd":193.29999995231628,"domainLookupStart":193.29999995231628,"fetchStart":193.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":193.29999995231628,"responseEnd":411.7999999523163,"responseStart":411.7999999523163,"secureConnectionStart":193.29999995231628},{"duration":219.29999995231628,"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":193.5,"connectEnd":193.5,"connectStart":193.5,"domainLookupEnd":193.5,"domainLookupStart":193.5,"fetchStart":193.5,"redirectEnd":0,"redirectStart":0,"requestStart":193.5,"responseEnd":412.7999999523163,"responseStart":412.7999999523163,"secureConnectionStart":193.5},{"duration":298.90000009536743,"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":193.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":193.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":492.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":219.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":194,"connectEnd":194,"connectStart":194,"domainLookupEnd":194,"domainLookupStart":194,"fetchStart":194,"redirectEnd":0,"redirectStart":0,"requestStart":194,"responseEnd":413.7000000476837,"responseStart":413.7000000476837,"secureConnectionStart":194},{"duration":298.69999980926514,"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":194.10000014305115,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":194.10000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":492.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":219.90000009536743,"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":194.29999995231628,"connectEnd":194.29999995231628,"connectStart":194.29999995231628,"domainLookupEnd":194.29999995231628,"domainLookupStart":194.29999995231628,"fetchStart":194.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":194.29999995231628,"responseEnd":414.2000000476837,"responseStart":414.2000000476837,"secureConnectionStart":194.29999995231628},{"duration":331.7999999523163,"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":200,"connectEnd":200,"connectStart":200,"domainLookupEnd":200,"domainLookupStart":200,"fetchStart":200,"redirectEnd":0,"redirectStart":0,"requestStart":200,"responseEnd":531.7999999523163,"responseStart":531.7999999523163,"secureConnectionStart":200},{"duration":397.10000014305115,"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":200,"connectEnd":200,"connectStart":200,"domainLookupEnd":200,"domainLookupStart":200,"fetchStart":200,"redirectEnd":0,"redirectStart":0,"requestStart":200,"responseEnd":597.1000001430511,"responseStart":597.1000001430511,"secureConnectionStart":200},{"duration":67.59999990463257,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":521.1000001430511,"connectEnd":521.1000001430511,"connectStart":521.1000001430511,"domainLookupEnd":521.1000001430511,"domainLookupStart":521.1000001430511,"fetchStart":521.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":521.1000001430511,"responseEnd":588.7000000476837,"responseStart":588.7000000476837,"secureConnectionStart":521.1000001430511},{"duration":211.89999985694885,"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&whisper-enabled=true","startTime":767.1000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":767.1000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":979,"responseStart":0,"secureConnectionStart":0},{"duration":222.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":768,"connectEnd":768,"connectStart":768,"domainLookupEnd":768,"domainLookupStart":768,"fetchStart":768,"redirectEnd":0,"redirectStart":0,"requestStart":768,"responseEnd":990.7000000476837,"responseStart":990.7000000476837,"secureConnectionStart":768},{"duration":230.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/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.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":768.4000000953674,"connectEnd":768.4000000953674,"connectStart":768.4000000953674,"domainLookupEnd":768.4000000953674,"domainLookupStart":768.4000000953674,"fetchStart":768.4000000953674,"redirectEnd":0,"redirectStart":0,"requestStart":768.4000000953674,"responseEnd":999.1000001430511,"responseStart":999.1000001430511,"secureConnectionStart":768.4000000953674}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":13,"responseStart":187,"responseEnd":194,"domLoading":190,"domInteractive":1012,"domContentLoadedEventStart":1012,"domContentLoadedEventEnd":1065,"domComplete":1341,"loadEventStart":1341,"loadEventEnd":1342,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":986.5},{"name":"bigPipe.sidebar-id.end","time":987.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":987.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":988.7000000476837},{"name":"activityTabFullyLoaded","time":1090.6000001430511}],"measures":[],"correlationId":"e44f7e8dc500d3","effectiveType":"4g","downlink":9.8,"rtt":0,"serverDuration":107,"dbReadsTimeInMs":20,"dbConnsTimeInMs":30,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}