Type:
Bug
Priority:
Minor
Resolution:
Fixed
Affects Version/s:
5.1.67 , 5.2.14 , 5.3.12 , 5.5.36 , 10.0.9
Description:
There is a problem on all platforms; to varying degrees.
Windows 32bit and Windows 64bit:
When supplied BIGINT UNSIGNED, the return type is a BIGINT SIGNED,
Others:
The return type appears to be valid however for BIGINT values, the comparison is always
performed as if the values were signed.
Workaround would be to use IF(x>y,x,y) function instead.
How to repeat:
To reproduce this bug, create this simple table.
DROP TABLE `cma`;
CREATE TABLE `cma` (
`a` binary (16) NOT NULL ,
`b` bigint (20) unsigned NOT NULL ,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Execute the following statement twice
INSERT INTO cma
(a, b)
VALUES ( 'foobar' ,13836376518955650385)
ON DUPLICATE KEY UPDATE
b=GREATEST(b, VALUES (b));
{"report":{"fcp":844.1000000238419,"ttfb":275.5,"pageVisibility":"visible","entityId":20995,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"4b08228c-5b69-40b8-a3d8-88b792d769e8","navigationType":0,"readyForUser":929.6000000238419,"redirectCount":0,"resourceLoadedEnd":959.1000000238419,"resourceLoadedStart":281,"resourceTiming":[{"duration":55.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":281,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":281,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":336.5,"responseStart":0,"secureConnectionStart":0},{"duration":55.900000005960464,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":281.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":281.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":337.2000000178814,"responseStart":0,"secureConnectionStart":0},{"duration":112.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/e9b27a47da5fb0f74a35acd57e9847fb-CDN/lu2bv2/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":281.40000000596046,"connectEnd":281.40000000596046,"connectStart":281.40000000596046,"domainLookupEnd":281.40000000596046,"domainLookupStart":281.40000000596046,"fetchStart":281.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":281.40000000596046,"responseEnd":394.2000000178814,"responseStart":394.2000000178814,"secureConnectionStart":281.40000000596046},{"duration":168.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/c32eb0da7ad9831253f8397e6cc26afd-CDN/lu2bv2/820016/12ta74/2380add21a9a1006587582385952de73/_/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":281.60000002384186,"connectEnd":281.60000002384186,"connectStart":281.60000002384186,"domainLookupEnd":281.60000002384186,"domainLookupStart":281.60000002384186,"fetchStart":281.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":281.60000002384186,"responseEnd":450.10000002384186,"responseStart":450.10000002384186,"secureConnectionStart":281.60000002384186},{"duration":172,"initiatorType":"script","name":"https://jira.mariadb.org/s/bc0bcb146314416123c992714ee00ff7-CDN/lu2bv2/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":281.80000001192093,"connectEnd":281.80000001192093,"connectStart":281.80000001192093,"domainLookupEnd":281.80000001192093,"domainLookupStart":281.80000001192093,"fetchStart":281.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":281.80000001192093,"responseEnd":453.80000001192093,"responseStart":453.80000001192093,"secureConnectionStart":281.80000001192093},{"duration":172.2000000178814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":282,"connectEnd":282,"connectStart":282,"domainLookupEnd":282,"domainLookupStart":282,"fetchStart":282,"redirectEnd":0,"redirectStart":0,"requestStart":282,"responseEnd":454.2000000178814,"responseStart":454.2000000178814,"secureConnectionStart":282},{"duration":172.40000000596046,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":282.2000000178814,"connectEnd":282.2000000178814,"connectStart":282.2000000178814,"domainLookupEnd":282.2000000178814,"domainLookupStart":282.2000000178814,"fetchStart":282.2000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":282.2000000178814,"responseEnd":454.60000002384186,"responseStart":454.60000002384186,"secureConnectionStart":282.2000000178814},{"duration":253.40000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bv2/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":282.40000000596046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":282.40000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":535.8000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":172.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":282.5,"connectEnd":282.5,"connectStart":282.5,"domainLookupEnd":282.5,"domainLookupStart":282.5,"fetchStart":282.5,"redirectEnd":0,"redirectStart":0,"requestStart":282.5,"responseEnd":455,"responseStart":455,"secureConnectionStart":282.5},{"duration":253.09999999403954,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bv2/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":282.80000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":282.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":535.9000000059605,"responseStart":0,"secureConnectionStart":0},{"duration":172.7000000178814,"initiatorType":"script","name":"https://jira.mariadb.org/s/719848dd97ebe0663199f49a3936487a-CDN/lu2bv2/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":282.90000000596046,"connectEnd":282.90000000596046,"connectStart":282.90000000596046,"domainLookupEnd":282.90000000596046,"domainLookupStart":282.90000000596046,"fetchStart":282.90000000596046,"redirectEnd":0,"redirectStart":0,"requestStart":282.90000000596046,"responseEnd":455.60000002384186,"responseStart":455.60000002384186,"secureConnectionStart":282.90000000596046},{"duration":531.6999999880791,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":283.60000002384186,"connectEnd":283.60000002384186,"connectStart":283.60000002384186,"domainLookupEnd":283.60000002384186,"domainLookupStart":283.60000002384186,"fetchStart":283.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":283.60000002384186,"responseEnd":815.3000000119209,"responseStart":815.3000000119209,"secureConnectionStart":283.60000002384186},{"duration":645.3000000119209,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":283.80000001192093,"connectEnd":283.80000001192093,"connectStart":283.80000001192093,"domainLookupEnd":283.80000001192093,"domainLookupStart":283.80000001192093,"fetchStart":283.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":283.80000001192093,"responseEnd":929.1000000238419,"responseStart":929.1000000238419,"secureConnectionStart":283.80000001192093},{"duration":252.80000001192093,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":562.8000000119209,"connectEnd":562.8000000119209,"connectStart":562.8000000119209,"domainLookupEnd":562.8000000119209,"domainLookupStart":562.8000000119209,"fetchStart":562.8000000119209,"redirectEnd":0,"redirectStart":0,"requestStart":562.8000000119209,"responseEnd":815.6000000238419,"responseStart":815.6000000238419,"secureConnectionStart":562.8000000119209},{"duration":161.90000000596046,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":838.2000000178814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":838.2000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1000.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":97.89999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bv2/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":860.1000000238419,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":860.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":958,"responseStart":0,"secureConnectionStart":0},{"duration":97.40000000596046,"initiatorType":"link","name":"https://jira.mariadb.org/s/50bc9be5bfead1a25e72c1a9338c94f6-CDN/lu2bv2/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/css/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":860.7000000178814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":860.7000000178814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":958.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":89.59999999403954,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bv2/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","startTime":861.6000000238419,"connectEnd":861.6000000238419,"connectStart":861.6000000238419,"domainLookupEnd":861.6000000238419,"domainLookupStart":861.6000000238419,"fetchStart":861.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":861.6000000238419,"responseEnd":951.2000000178814,"responseStart":951.2000000178814,"secureConnectionStart":861.6000000238419},{"duration":95.69999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/53a43b6764f587426c7bb9a150184c00-CDN/lu2bv2/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","startTime":862.1000000238419,"connectEnd":862.1000000238419,"connectStart":862.1000000238419,"domainLookupEnd":862.1000000238419,"domainLookupStart":862.1000000238419,"fetchStart":862.1000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":862.1000000238419,"responseEnd":957.8000000119209,"responseStart":957.8000000119209,"secureConnectionStart":862.1000000238419},{"duration":96.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/630dda803a823fdd5771c4338338e018-CDN/lu2bv2/820016/12ta74/e108c7645258ccb43280ed3404e3e949/_/download/contextbatch/js/com.atlassian.jira.plugins.jira-development-integration-plugin:0,-_super,-jira.view.issue,-jira.global,-jira.general,-jira.browse.project,-project.issue.navigator,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":862.6000000238419,"connectEnd":862.6000000238419,"connectStart":862.6000000238419,"domainLookupEnd":862.6000000238419,"domainLookupStart":862.6000000238419,"fetchStart":862.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":862.6000000238419,"responseEnd":959.1000000238419,"responseStart":959.1000000238419,"secureConnectionStart":862.6000000238419}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":88,"responseStart":276,"responseEnd":279,"domLoading":279,"domInteractive":1048,"domContentLoadedEventStart":1048,"domContentLoadedEventEnd":1094,"domComplete":1237,"loadEventStart":1237,"loadEventEnd":1239,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1010.2000000178814},{"name":"bigPipe.sidebar-id.end","time":1011},{"name":"bigPipe.activity-panel-pipe-id.start","time":1011.1000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":1013.1000000238419},{"name":"activityTabFullyLoaded","time":1111.2000000178814}],"measures":[],"correlationId":"31e290e8bfce0c","effectiveType":"4g","downlink":9.4,"rtt":0,"serverDuration":117,"dbReadsTimeInMs":15,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Win32/Win64: GREATEST() does not always return same signness of argument types.
This problem occurs on Windows 32bit and Windows 64bit.
To reproduce this bug, create this simple table.
DROP TABLE `cma`;
CREATE TABLE `cma` (
`a` binary(16) NOT NULL,
`b` bigint(20) unsigned NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
– Execute the following statement twice
INSERT INTO cma
(a, b)
VALUES ('foobar',13836376518955650385)
ON DUPLICATE KEY UPDATE
b=GREATEST(b,VALUES(b));
A workaround may be to use CAST(GREATEST(...) AS UNSIGNED) .