I run this script:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a TIMESTAMP);
|
DROP TABLE IF EXISTS t2;
|
CREATE TABLE t2 AS SELECT
|
MAX(a),
|
COALESCE(a),
|
COALESCE(MAX(a)),
|
MAX(COALESCE(a))
|
FROM t1;
|
SHOW CREATE TABLE t2;
|
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| t2 | CREATE TABLE `t2` (
|
`MAX(a)` timestamp NULL DEFAULT NULL,
|
`COALESCE(a)` timestamp NULL DEFAULT NULL,
|
`COALESCE(MAX(a))` timestamp NULL DEFAULT NULL,
|
`MAX(COALESCE(a))` datetime DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
Notice, it creates TIMESTAMP fields for all expression but MAX(COALESCE(a)). Looks confusing.
Moreover, if I run the client as:
mysql --column-type-info test
|
and execute this script:
SELECT
|
MAX(a),
|
COALESCE(a),
|
COALESCE(MAX(a)),
|
MAX(COALESCE(a))
|
FROM t1;
|
Field 1: `MAX(a)`
|
Type: TIMESTAMP
|
...
|
Field 2: `COALESCE(a)`
|
Type: TIMESTAMP
|
...
|
Field 3: `COALESCE(MAX(a))`
|
Type: TIMESTAMP
|
...
|
Field 4: `MAX(COALESCE(a))`
|
Type: TIMESTAMP
|
Collation: binary (63)
|
It correctly reports TIMESTAP for all columns.
- blocks
-
MDEV-4912
Data type plugin API version 1
-
-
Closed
{"report":{"fcp":913.5,"ttfb":226.39999961853027,"pageVisibility":"visible","entityId":61047,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"6d3d5080-b635-42e1-a5ff-094a79278208","navigationType":0,"readyForUser":999.5,"redirectCount":0,"resourceLoadedEnd":1744.1999998092651,"resourceLoadedStart":231.79999923706055,"resourceTiming":[{"duration":204.30000019073486,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":231.79999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":231.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":436.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":204.30000019073486,"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":232.0999994277954,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":232.0999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":436.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":213.4000005722046,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":232.29999923706055,"connectEnd":232.29999923706055,"connectStart":232.29999923706055,"domainLookupEnd":232.29999923706055,"domainLookupStart":232.29999923706055,"fetchStart":232.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":232.29999923706055,"responseEnd":445.69999980926514,"responseStart":445.69999980926514,"secureConnectionStart":232.29999923706055},{"duration":333.69999980926514,"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":233,"connectEnd":233,"connectStart":233,"domainLookupEnd":233,"domainLookupStart":233,"fetchStart":233,"redirectEnd":0,"redirectStart":0,"requestStart":233,"responseEnd":566.6999998092651,"responseStart":566.6999998092651,"secureConnectionStart":233},{"duration":337.3999996185303,"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":233.39999961853027,"connectEnd":233.39999961853027,"connectStart":233.39999961853027,"domainLookupEnd":233.39999961853027,"domainLookupStart":233.39999961853027,"fetchStart":233.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":233.39999961853027,"responseEnd":570.7999992370605,"responseStart":570.7999992370605,"secureConnectionStart":233.39999961853027},{"duration":337.4000005722046,"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":233.79999923706055,"connectEnd":233.79999923706055,"connectStart":233.79999923706055,"domainLookupEnd":233.79999923706055,"domainLookupStart":233.79999923706055,"fetchStart":233.79999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":233.79999923706055,"responseEnd":571.1999998092651,"responseStart":571.0999994277954,"secureConnectionStart":233.79999923706055},{"duration":337.5999994277954,"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":234,"connectEnd":234,"connectStart":234,"domainLookupEnd":234,"domainLookupStart":234,"fetchStart":234,"redirectEnd":0,"redirectStart":0,"requestStart":234,"responseEnd":571.5999994277954,"responseStart":571.5999994277954,"secureConnectionStart":234},{"duration":360.70000076293945,"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":234.29999923706055,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.29999923706055,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":595,"responseStart":0,"secureConnectionStart":0},{"duration":337.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":234.5999994277954,"connectEnd":234.5999994277954,"connectStart":234.5999994277954,"domainLookupEnd":234.5999994277954,"domainLookupStart":234.5999994277954,"fetchStart":234.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":234.5999994277954,"responseEnd":572.0999994277954,"responseStart":572.0999994277954,"secureConnectionStart":234.5999994277954},{"duration":360.3999996185303,"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":234.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":595.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":337.5999994277954,"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":235,"connectEnd":235,"connectStart":235,"domainLookupEnd":235,"domainLookupStart":235,"fetchStart":235,"redirectEnd":0,"redirectStart":0,"requestStart":235,"responseEnd":572.5999994277954,"responseStart":572.5999994277954,"secureConnectionStart":235},{"duration":916.3999996185303,"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":235.89999961853027,"connectEnd":235.89999961853027,"connectStart":235.89999961853027,"domainLookupEnd":235.89999961853027,"domainLookupStart":235.89999961853027,"fetchStart":235.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":235.89999961853027,"responseEnd":1152.2999992370605,"responseStart":1152.2999992370605,"secureConnectionStart":235.89999961853027},{"duration":1508.3000001907349,"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":235.89999961853027,"connectEnd":235.89999961853027,"connectStart":235.89999961853027,"domainLookupEnd":235.89999961853027,"domainLookupStart":235.89999961853027,"fetchStart":235.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":235.89999961853027,"responseEnd":1744.1999998092651,"responseStart":1744.1999998092651,"secureConnectionStart":235.89999961853027},{"duration":545.1000003814697,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":607.5999994277954,"connectEnd":607.5999994277954,"connectStart":607.5999994277954,"domainLookupEnd":607.5999994277954,"domainLookupStart":607.5999994277954,"fetchStart":607.5999994277954,"redirectEnd":0,"redirectStart":0,"requestStart":607.5999994277954,"responseEnd":1152.6999998092651,"responseStart":1152.6999998092651,"secureConnectionStart":607.5999994277954},{"duration":855.1999998092651,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":907.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":907.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1762.6999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":60,"responseStart":226,"responseEnd":228,"domLoading":229,"domInteractive":1763,"domContentLoadedEventStart":1763,"domContentLoadedEventEnd":1804,"domComplete":3517,"loadEventStart":3517,"loadEventEnd":3519,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1745.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1746.5999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1746.7999992370605},{"name":"bigPipe.activity-panel-pipe-id.end","time":1749.0999994277954},{"name":"activityTabFullyLoaded","time":1811.0999994277954}],"measures":[],"correlationId":"b61ec6eb573cf7","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":103,"dbReadsTimeInMs":13,"dbConnsTimeInMs":23,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}