Implicit CAST from string to signed bigint truncates the number the to maximum possible 64-bit signed value:
DROP TABLE IF EXISTS t1;
|
CREATE TABLE t1 (a BIGINT);
|
INSERT INTO t1 VALUES ('99999999999999999999');
|
SELECT * FROM t1;
|
+---------------------+
|
| a |
|
+---------------------+
|
| 9223372036854775807 |
|
+---------------------+
|
So does explicit CAST from DECIMAL to SIGNED:
SELECT CAST(99999999999999999999 AS SIGNED);
|
+--------------------------------------+
|
| CAST(99999999999999999999 AS SIGNED) |
|
+--------------------------------------+
|
| 9223372036854775807 |
|
+--------------------------------------+
|
So does explicit CAST from DOUBLE to SIGNED:
SELECT CAST(99999999999999999999e0 AS SIGNED);
|
+----------------------------------------+
|
| CAST(99999999999999999999e0 AS SIGNED) |
|
+----------------------------------------+
|
| 9223372036854775807 |
|
+----------------------------------------+
|
Explicit CAST from string to SIGNED works differently:
SELECT CAST('99999999999999999999' AS SIGNED);
|
+----------------------------------------+
|
| CAST('99999999999999999999' AS SIGNED) |
|
+----------------------------------------+
|
| -1 |
|
+----------------------------------------+
|
This looks wrong. Explicit CAST from string to SIGNED should also return 9223372036854775807.
{"report":{"fcp":806.2999999523163,"ttfb":184,"pageVisibility":"visible","entityId":57271,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"23fc49ed-f820-4032-8869-6146298f5e07","navigationType":0,"readyForUser":923.7000000476837,"redirectCount":0,"resourceLoadedEnd":523.7000000476837,"resourceLoadedStart":191.70000004768372,"resourceTiming":[{"duration":14.399999856948853,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":191.70000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":191.70000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":206.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":15.200000047683716,"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":191.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":191.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":207,"responseStart":0,"secureConnectionStart":0},{"duration":217.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":191.90000009536743,"connectEnd":191.90000009536743,"connectStart":191.90000009536743,"domainLookupEnd":191.90000009536743,"domainLookupStart":191.90000009536743,"fetchStart":191.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":211.29999995231628,"responseEnd":409.59999990463257,"responseStart":236.59999990463257,"secureConnectionStart":191.90000009536743},{"duration":331.7000000476837,"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":192,"connectEnd":192,"connectStart":192,"domainLookupEnd":192,"domainLookupStart":192,"fetchStart":192,"redirectEnd":0,"redirectStart":0,"requestStart":215,"responseEnd":523.7000000476837,"responseStart":241.20000004768372,"secureConnectionStart":192},{"duration":53.39999985694885,"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":192.20000004768372,"connectEnd":192.20000004768372,"connectStart":192.20000004768372,"domainLookupEnd":192.20000004768372,"domainLookupStart":192.20000004768372,"fetchStart":192.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":215.40000009536743,"responseEnd":245.59999990463257,"responseStart":242.90000009536743,"secureConnectionStart":192.20000004768372},{"duration":43.799999952316284,"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":210.90000009536743,"connectEnd":210.90000009536743,"connectStart":210.90000009536743,"domainLookupEnd":210.90000009536743,"domainLookupStart":210.90000009536743,"fetchStart":210.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":225.59999990463257,"responseEnd":254.70000004768372,"responseStart":248.40000009536743,"secureConnectionStart":210.90000009536743},{"duration":44,"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":211.09999990463257,"connectEnd":211.09999990463257,"connectStart":211.09999990463257,"domainLookupEnd":211.09999990463257,"domainLookupStart":211.09999990463257,"fetchStart":211.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":226,"responseEnd":255.09999990463257,"responseStart":249.79999995231628,"secureConnectionStart":211.09999990463257},{"duration":8.099999904632568,"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":211.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":219.29999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":44,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":211.29999995231628,"connectEnd":211.29999995231628,"connectStart":211.29999995231628,"domainLookupEnd":211.29999995231628,"domainLookupStart":211.29999995231628,"fetchStart":211.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":226.29999995231628,"responseEnd":255.29999995231628,"responseStart":251.09999990463257,"secureConnectionStart":211.29999995231628},{"duration":9.399999856948853,"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":211.40000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":211.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":220.79999995231628,"responseStart":0,"secureConnectionStart":0},{"duration":44.19999980926514,"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":211.40000009536743,"connectEnd":211.40000009536743,"connectStart":211.40000009536743,"domainLookupEnd":211.40000009536743,"domainLookupStart":211.40000009536743,"fetchStart":211.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":227.29999995231628,"responseEnd":255.59999990463257,"responseStart":252.20000004768372,"secureConnectionStart":211.40000009536743},{"duration":4.6000001430511475,"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":262.2999999523163,"connectEnd":262.2999999523163,"connectStart":262.2999999523163,"domainLookupEnd":262.2999999523163,"domainLookupStart":262.2999999523163,"fetchStart":262.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":262.2999999523163,"responseEnd":266.90000009536743,"responseStart":266.90000009536743,"secureConnectionStart":262.2999999523163},{"duration":9.599999904632568,"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":262.40000009536743,"connectEnd":262.40000009536743,"connectStart":262.40000009536743,"domainLookupEnd":262.40000009536743,"domainLookupStart":262.40000009536743,"fetchStart":262.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":262.40000009536743,"responseEnd":272,"responseStart":272,"secureConnectionStart":262.40000009536743},{"duration":95.60000014305115,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":561.0999999046326,"connectEnd":561.0999999046326,"connectStart":561.0999999046326,"domainLookupEnd":561.0999999046326,"domainLookupStart":561.0999999046326,"fetchStart":561.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":627.0999999046326,"responseEnd":656.7000000476837,"responseStart":655.5999999046326,"secureConnectionStart":561.0999999046326}],"fetchStart":0,"domainLookupStart":12,"domainLookupEnd":19,"connectStart":19,"connectEnd":39,"secureConnectionStart":28,"requestStart":39,"responseStart":184,"responseEnd":261,"domLoading":187,"domInteractive":980,"domContentLoadedEventStart":980,"domContentLoadedEventEnd":1020,"domComplete":1441,"loadEventStart":1441,"loadEventEnd":1442,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":962.2000000476837},{"name":"bigPipe.sidebar-id.end","time":963},{"name":"bigPipe.activity-panel-pipe-id.start","time":963.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":964.2000000476837},{"name":"activityTabFullyLoaded","time":1035.0999999046326}],"measures":[],"correlationId":"49afd1a45ce92c","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":75,"dbReadsTimeInMs":10,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Dynamic columns also do not work well:
+------------------------------------------------------------------+
| COLUMN_GET(COLUMN_CREATE(0,'99999999999999999999'), 0 AS SIGNED) |
+------------------------------------------------------------------+
| -1 |
+------------------------------------------------------------------+