CREATEORREPLACETABLE t2 ASSELECTAVG(MICROSECOND(a)) FROM t1;
ERROR 1264 (22003): Outof range value forcolumn'AVG(MICROSECOND(a))'at row 2
Alexander Barkov
added a comment - A few other functions have the same problem:
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG ( MONTH (a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(MONTH(a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG ( DAY (a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(DAY(a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG (DAYOFYEAR(a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(DAYOFYEAR(a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG (WEEK(a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(WEEK(a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG ( HOUR (a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(HOUR(a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG ( MINUTE (a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(MINUTE(a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG ( SECOND (a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(SECOND(a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME(6));
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30.999999' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG (MICROSECOND(a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(MICROSECOND(a))' at row 2
CREATEORREPLACETABLE t2 ASSELECTAVG(EXTRACT(YEARFROM a)) FROM t1;
ERROR 1264 (22003): Outof range value forcolumn'AVG(EXTRACT(YEAR FROM a))'at row 2
CREATEORREPLACETABLE t1 (a DATETIME);
INSERTINTO t1 VALUES ('2001-12-31 10:20:30');
CREATEORREPLACETABLE t2 ASSELECTAVG(EXTRACT(MONTHFROM a)) FROM t1;
ERROR 1264 (22003): Outof range value forcolumn'AVG(EXTRACT(MONTH FROM a))'at row 2
Alexander Barkov
added a comment - Some EXTRACT(unit FROM dt) have the same problem:
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG (EXTRACT( YEAR FROM a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(EXTRACT(YEAR FROM a))' at row 2
CREATE OR REPLACE TABLE t1 (a DATETIME);
INSERT INTO t1 VALUES ( '2001-12-31 10:20:30' );
CREATE OR REPLACE TABLE t2 AS SELECT AVG (EXTRACT( MONTH FROM a)) FROM t1;
ERROR 1264 (22003): Out of range value for column 'AVG(EXTRACT(MONTH FROM a))' at row 2
The same problem is repeatable with all these statements:
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING YEAR(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING QUARTER(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MONTH(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING WEEK(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING DAY(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING DAYOFYEAR(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING HOUR(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MINUTE(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING SECOND(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MICROSECOND(TIMESTAMP'2001-12-31 10:20:30');
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MICROSECOND(TIMESTAMP'2001-12-31 10:20:30.999999');
Alexander Barkov
added a comment - The same problem is repeatable with all these statements:
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING YEAR ( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING QUARTER( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MONTH ( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING WEEK( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING DAY ( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING DAYOFYEAR( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING HOUR ( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MINUTE ( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING SECOND ( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MICROSECOND( TIMESTAMP '2001-12-31 10:20:30' );
EXECUTE IMMEDIATE 'CREATE OR REPLACE TABLE t2 AS SELECT AVG(?)' USING MICROSECOND( TIMESTAMP '2001-12-31 10:20:30.999999' );
People
Alexander Barkov
Alexander Barkov
Votes:
0Vote for this issue
Watchers:
1Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":948.6999999880791,"ttfb":228.89999997615814,"pageVisibility":"visible","entityId":127986,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"21b55038-02ab-4e60-a2b8-20970b1a3384","navigationType":0,"readyForUser":1028,"redirectCount":0,"resourceLoadedEnd":1095.199999988079,"resourceLoadedStart":234.5,"resourceTiming":[{"duration":194.80000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":234.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":429.30000001192093,"responseStart":0,"secureConnectionStart":0},{"duration":194.9000000357628,"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":234.69999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":234.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":429.60000002384186,"responseStart":0,"secureConnectionStart":0},{"duration":218,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":234.89999997615814,"connectEnd":234.89999997615814,"connectStart":234.89999997615814,"domainLookupEnd":234.89999997615814,"domainLookupStart":234.89999997615814,"fetchStart":234.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":234.89999997615814,"responseEnd":452.89999997615814,"responseStart":452.89999997615814,"secureConnectionStart":234.89999997615814},{"duration":304,"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":235.10000002384186,"connectEnd":235.10000002384186,"connectStart":235.10000002384186,"domainLookupEnd":235.10000002384186,"domainLookupStart":235.10000002384186,"fetchStart":235.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":235.10000002384186,"responseEnd":539.1000000238419,"responseStart":539.1000000238419,"secureConnectionStart":235.10000002384186},{"duration":307.39999997615814,"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":235.30000001192093,"connectEnd":235.30000001192093,"connectStart":235.30000001192093,"domainLookupEnd":235.30000001192093,"domainLookupStart":235.30000001192093,"fetchStart":235.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":235.30000001192093,"responseEnd":542.6999999880791,"responseStart":542.6999999880791,"secureConnectionStart":235.30000001192093},{"duration":307.7999999523163,"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":235.60000002384186,"connectEnd":235.60000002384186,"connectStart":235.60000002384186,"domainLookupEnd":235.60000002384186,"domainLookupStart":235.60000002384186,"fetchStart":235.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":235.60000002384186,"responseEnd":543.3999999761581,"responseStart":543.3999999761581,"secureConnectionStart":235.60000002384186},{"duration":308.10000002384186,"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":235.69999998807907,"connectEnd":235.69999998807907,"connectStart":235.69999998807907,"domainLookupEnd":235.69999998807907,"domainLookupStart":235.69999998807907,"fetchStart":235.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":235.69999998807907,"responseEnd":543.8000000119209,"responseStart":543.8000000119209,"secureConnectionStart":235.69999998807907},{"duration":359.9000000357628,"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":235.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":235.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":595.8000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":308.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":236,"connectEnd":236,"connectStart":236,"domainLookupEnd":236,"domainLookupStart":236,"fetchStart":236,"redirectEnd":0,"redirectStart":0,"requestStart":236,"responseEnd":544.1999999880791,"responseStart":544.1999999880791,"secureConnectionStart":236},{"duration":359.7999999523163,"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":236.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":236.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":595.8999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":308.5,"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":236.30000001192093,"connectEnd":236.30000001192093,"connectStart":236.30000001192093,"domainLookupEnd":236.30000001192093,"domainLookupStart":236.30000001192093,"fetchStart":236.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":236.30000001192093,"responseEnd":544.8000000119209,"responseStart":544.8000000119209,"secureConnectionStart":236.30000001192093},{"duration":415.2999999523163,"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":237.10000002384186,"connectEnd":237.10000002384186,"connectStart":237.10000002384186,"domainLookupEnd":237.10000002384186,"domainLookupStart":237.10000002384186,"fetchStart":237.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":237.10000002384186,"responseEnd":652.3999999761581,"responseStart":652.3999999761581,"secureConnectionStart":237.10000002384186},{"duration":492.5999999642372,"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":243.80000001192093,"connectEnd":243.80000001192093,"connectStart":243.80000001192093,"domainLookupEnd":243.80000001192093,"domainLookupStart":243.80000001192093,"fetchStart":243.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":243.80000001192093,"responseEnd":736.3999999761581,"responseStart":736.3999999761581,"secureConnectionStart":243.80000001192093},{"duration":51,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":623.1999999880791,"connectEnd":623.1999999880791,"connectStart":623.1999999880791,"domainLookupEnd":623.1999999880791,"domainLookupStart":623.1999999880791,"fetchStart":623.1999999880791,"redirectEnd":0,"redirectStart":0,"requestStart":623.1999999880791,"responseEnd":674.1999999880791,"responseStart":674.1999999880791,"secureConnectionStart":623.1999999880791},{"duration":231.0999999642372,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/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","startTime":864.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":864.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1095.199999988079,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":43,"responseStart":229,"responseEnd":243,"domLoading":232,"domInteractive":1108,"domContentLoadedEventStart":1108,"domContentLoadedEventEnd":1173,"domComplete":1302,"loadEventStart":1302,"loadEventEnd":1303,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1065.300000011921},{"name":"bigPipe.sidebar-id.end","time":1066.199999988079},{"name":"bigPipe.activity-panel-pipe-id.start","time":1066.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1071.300000011921},{"name":"activityTabFullyLoaded","time":1192.1000000238419}],"measures":[],"correlationId":"ea14cdf579d56d","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":118,"dbReadsTimeInMs":13,"dbConnsTimeInMs":22,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
A few other functions have the same problem: