DELIMITER $$
|
BEGIN NOT ATOMIC
|
DECLARE d0 DATETIME DEFAULT NULL;
|
DECLARE d1 DATETIME DEFAULT '2001-01-01 00:00:00';
|
DECLARE i0 INT DEFAULT NULL;
|
DECLARE i1 INT DEFAULT 10;
|
PREPARE stmt FROM 'CREATE OR REPLACE TABLE t1 AS SELECT ? AS c1,? AS c2,? AS c3,? AS c4';
|
EXECUTE stmt USING d0,d1,i0,i1;
|
DEALLOCATE PREPARE stmt;
|
SHOW CREATE TABLE t1;
|
END;
|
$$
|
DELIMITER ;
|
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
| t1 | CREATE TABLE `t1` (
|
`c1` binary(0) DEFAULT NULL,
|
`c2` datetime DEFAULT NULL,
|
`c3` binary(0) DEFAULT NULL,
|
`c4` bigint(21) NOT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|
The expected data type for c0 should be DATETIME (like for c1).
The expected data type for c3 should be BIGINT (like for c3).
{"report":{"fcp":1452.0999999046326,"ttfb":589,"pageVisibility":"visible","entityId":64107,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":32,"apdex":0.5,"journeyId":"5fa2b87d-9268-4574-b020-7c46b71b8a62","navigationType":0,"readyForUser":1532.2999999523163,"redirectCount":0,"resourceLoadedEnd":1176.0999999046326,"resourceLoadedStart":598,"resourceTiming":[{"duration":83.39999985694885,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":598,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":598,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":681.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":87.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":598.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":598.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":685.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":396.89999985694885,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":598.5,"connectEnd":598.5,"connectStart":598.5,"domainLookupEnd":598.5,"domainLookupStart":598.5,"fetchStart":598.5,"redirectEnd":0,"redirectStart":0,"requestStart":688.2999999523163,"responseEnd":995.3999998569489,"responseStart":701.2999999523163,"secureConnectionStart":598.5},{"duration":577,"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":599.0999999046326,"connectEnd":599.0999999046326,"connectStart":599.0999999046326,"domainLookupEnd":599.0999999046326,"domainLookupStart":599.0999999046326,"fetchStart":599.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":689.7999999523163,"responseEnd":1176.0999999046326,"responseStart":710.5999999046326,"secureConnectionStart":599.0999999046326},{"duration":122.40000009536743,"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":599.1999998092651,"connectEnd":599.1999998092651,"connectStart":599.1999998092651,"domainLookupEnd":599.1999998092651,"domainLookupStart":599.1999998092651,"fetchStart":599.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":690,"responseEnd":721.5999999046326,"responseStart":718.2999999523163,"secureConnectionStart":599.1999998092651},{"duration":126.29999995231628,"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":599.2999999523163,"connectEnd":599.2999999523163,"connectStart":599.2999999523163,"domainLookupEnd":599.2999999523163,"domainLookupStart":599.2999999523163,"fetchStart":599.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":690.5999999046326,"responseEnd":725.5999999046326,"responseStart":719.6999998092651,"secureConnectionStart":599.2999999523163},{"duration":126.79999995231628,"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":599.2999999523163,"connectEnd":599.2999999523163,"connectStart":599.2999999523163,"domainLookupEnd":599.2999999523163,"domainLookupStart":599.2999999523163,"fetchStart":599.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":691.1999998092651,"responseEnd":726.0999999046326,"responseStart":722,"secureConnectionStart":599.2999999523163},{"duration":91.89999985694885,"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":599.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":599.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":691.3999998569489,"responseStart":0,"secureConnectionStart":0},{"duration":127,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":599.5999999046326,"connectEnd":599.5999999046326,"connectStart":599.5999999046326,"domainLookupEnd":599.5999999046326,"domainLookupStart":599.5999999046326,"fetchStart":599.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":694.0999999046326,"responseEnd":726.5999999046326,"responseStart":723,"secureConnectionStart":599.5999999046326},{"duration":92.60000014305115,"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":599.6999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":599.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":692.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":128.70000004768372,"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":599.7999999523163,"connectEnd":599.7999999523163,"connectStart":599.7999999523163,"domainLookupEnd":599.7999999523163,"domainLookupStart":599.7999999523163,"fetchStart":599.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":695.3999998569489,"responseEnd":728.5,"responseStart":726.8999998569489,"secureConnectionStart":599.7999999523163},{"duration":496.2000000476837,"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":603.7999999523163,"connectEnd":603.7999999523163,"connectStart":603.7999999523163,"domainLookupEnd":603.7999999523163,"domainLookupStart":603.7999999523163,"fetchStart":603.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":766.6999998092651,"responseEnd":1100,"responseStart":1094.5,"secureConnectionStart":603.7999999523163},{"duration":496.60000014305115,"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":603.8999998569489,"connectEnd":603.8999998569489,"connectStart":603.8999998569489,"domainLookupEnd":603.8999998569489,"domainLookupStart":603.8999998569489,"fetchStart":603.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":822.5,"responseEnd":1100.5,"responseStart":1096,"secureConnectionStart":603.8999998569489},{"duration":101.70000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1146.6999998092651,"connectEnd":1146.6999998092651,"connectStart":1146.6999998092651,"domainLookupEnd":1146.6999998092651,"domainLookupStart":1146.6999998092651,"fetchStart":1146.6999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1215.5,"responseEnd":1248.3999998569489,"responseStart":1247.1999998092651,"secureConnectionStart":1146.6999998092651},{"duration":255.20000004768372,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1400.5999999046326,"connectEnd":1400.5999999046326,"connectStart":1400.5999999046326,"domainLookupEnd":1400.5999999046326,"domainLookupStart":1400.5999999046326,"fetchStart":1400.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1621,"responseEnd":1655.7999999523163,"responseStart":1652,"secureConnectionStart":1400.5999999046326},{"duration":179.79999995231628,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1441.8999998569489,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1441.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1621.6999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":421,"responseStart":589,"responseEnd":603,"domLoading":592,"domInteractive":1599,"domContentLoadedEventStart":1599,"domContentLoadedEventEnd":1661,"domComplete":1966,"loadEventStart":1966,"loadEventEnd":1966,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1574.3999998569489},{"name":"bigPipe.sidebar-id.end","time":1575.2999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":1575.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1577.5999999046326},{"name":"activityTabFullyLoaded","time":1712.5}],"measures":[],"correlationId":"785805cfafcd0b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":95,"dbReadsTimeInMs":14,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
The same problem is repeatable with functions returning NULL:
DELIMITER $$
$$
DELIMITER ;
+-------+------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`d0` datetime DEFAULT NULL,
`d1` binary(0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+------------------------------------------------------------------------------------------------------------------------+
Notice, the data type for d1 is wrong. It should be datetime.
Note, this script, with direct non-prepared execution, correctly creates two datetime columns:
+-------+-----------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+-----------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`d0` datetime DEFAULT NULL,
`d1` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+-----------------------------------------------------------------------------------------------------------------------+