Type:
Bug
Priority:
Major
Resolution:
Unresolved
Affects Version/s:
10.4.5 , 5.5(EOL) , 10.0(EOL) , 10.1(EOL) , 10.2(EOL) , 10.3(EOL) , 10.4(EOL)
Environment:
MariaDB Docker (Bionic) on Ubuntu Linux 18.04
Summary: The following sql query leads to ' BIGINT value is out of range in '"A"."B"."C" * "A"."B"."C" * "A"."B"."C" * "A"."B"."C" * "A"."B"."C" * "A"."B"."C"'', propably due to expression replacement:
CREATE SCHEMA A;
CREATE TABLE A.B (C BIGINT );
INSERT INTO A.B VALUES (-5500);
SELECT 1 AS A FROM ( SELECT B.C * B.C AS A FROM A.B WHERE B.C * B.C < 10) A WHERE ( A.A * A.A * A.A * A.A ) = A.A ;
Normally, the condition in the inner SELECT should restrict execution of the outher WHERE clause to 'valid' expressions, but it seems like the expression 'B.C * B.C' from the inner select replaces the outer ones without the check before.
In Postgres, this is handled correctly, no exception occurs (and no result is returned because nothing machtes the query currently), in MariaDB, an exception occurs.
The same exception occurs in MySQL 8.0.16. I'm not sure about other mariadb or mysql versions.
Even though this example is a bit 'constructed', all WHERE conditions which restrict the range of expressions are affected.
{"report":{"fcp":870.1999998092651,"ttfb":161.39999961853027,"pageVisibility":"visible","entityId":76825,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"dfa3cdb9-9d6d-41b3-96d5-74f1d5c9bb4b","navigationType":0,"readyForUser":940.1999998092651,"redirectCount":0,"resourceLoadedEnd":1431.8999996185303,"resourceLoadedStart":167.19999980926514,"resourceTiming":[{"duration":235.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":167.19999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":167.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":402.80000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":235.60000038146973,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":167.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":167.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":403.1000003814697,"responseStart":0,"secureConnectionStart":0},{"duration":244.79999923706055,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":167.60000038146973,"connectEnd":167.60000038146973,"connectStart":167.60000038146973,"domainLookupEnd":167.60000038146973,"domainLookupStart":167.60000038146973,"fetchStart":167.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":167.60000038146973,"responseEnd":412.3999996185303,"responseStart":412.3999996185303,"secureConnectionStart":167.60000038146973},{"duration":295.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/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":167.80000019073486,"connectEnd":167.80000019073486,"connectStart":167.80000019073486,"domainLookupEnd":167.80000019073486,"domainLookupStart":167.80000019073486,"fetchStart":167.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":167.80000019073486,"responseEnd":463.5,"responseStart":463.5,"secureConnectionStart":167.80000019073486},{"duration":299.6000003814697,"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":168,"connectEnd":168,"connectStart":168,"domainLookupEnd":168,"domainLookupStart":168,"fetchStart":168,"redirectEnd":0,"redirectStart":0,"requestStart":168,"responseEnd":467.6000003814697,"responseStart":467.6000003814697,"secureConnectionStart":168},{"duration":299.9000005722046,"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":168.19999980926514,"connectEnd":168.19999980926514,"connectStart":168.19999980926514,"domainLookupEnd":168.19999980926514,"domainLookupStart":168.19999980926514,"fetchStart":168.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":168.19999980926514,"responseEnd":468.1000003814697,"responseStart":468.1000003814697,"secureConnectionStart":168.19999980926514},{"duration":300.1000003814697,"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":168.39999961853027,"connectEnd":168.39999961853027,"connectStart":168.39999961853027,"domainLookupEnd":168.39999961853027,"domainLookupStart":168.39999961853027,"fetchStart":168.39999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":168.39999961853027,"responseEnd":468.5,"responseStart":468.5,"secureConnectionStart":168.39999961853027},{"duration":387.69999980926514,"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":168.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":168.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":556.3000001907349,"responseStart":0,"secureConnectionStart":0},{"duration":300.5,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":168.80000019073486,"connectEnd":168.80000019073486,"connectStart":168.80000019073486,"domainLookupEnd":168.80000019073486,"domainLookupStart":168.80000019073486,"fetchStart":168.80000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":168.80000019073486,"responseEnd":469.30000019073486,"responseStart":469.30000019073486,"secureConnectionStart":168.80000019073486},{"duration":387.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":169,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":169,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":556.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":301,"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":169.10000038146973,"connectEnd":169.10000038146973,"connectStart":169.10000038146973,"domainLookupEnd":169.10000038146973,"domainLookupStart":169.10000038146973,"fetchStart":169.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":169.10000038146973,"responseEnd":470.1000003814697,"responseStart":470.1000003814697,"secureConnectionStart":169.10000038146973},{"duration":1260.1000003814697,"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":169.89999961853027,"connectEnd":169.89999961853027,"connectStart":169.89999961853027,"domainLookupEnd":169.89999961853027,"domainLookupStart":169.89999961853027,"fetchStart":169.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":169.89999961853027,"responseEnd":1430,"responseStart":1430,"secureConnectionStart":169.89999961853027},{"duration":1262,"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":169.89999961853027,"connectEnd":169.89999961853027,"connectStart":169.89999961853027,"domainLookupEnd":169.89999961853027,"domainLookupStart":169.89999961853027,"fetchStart":169.89999961853027,"redirectEnd":0,"redirectStart":0,"requestStart":169.89999961853027,"responseEnd":1431.8999996185303,"responseStart":1431.8999996185303,"secureConnectionStart":169.89999961853027},{"duration":538.1999998092651,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":568.1999998092651,"connectEnd":568.1999998092651,"connectStart":568.1999998092651,"domainLookupEnd":568.1999998092651,"domainLookupStart":568.1999998092651,"fetchStart":568.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":568.1999998092651,"responseEnd":1106.3999996185303,"responseStart":1106.3999996185303,"secureConnectionStart":568.1999998092651},{"duration":582.3000001907349,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":862.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":862.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1445.1999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":12,"responseStart":161,"responseEnd":162,"domLoading":164,"domInteractive":1449,"domContentLoadedEventStart":1449,"domContentLoadedEventEnd":1487,"domComplete":2213,"loadEventStart":2213,"loadEventEnd":2215,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1433.8999996185303},{"name":"bigPipe.sidebar-id.end","time":1434.8000001907349},{"name":"bigPipe.activity-panel-pipe-id.start","time":1435},{"name":"bigPipe.activity-panel-pipe-id.end","time":1437.3000001907349},{"name":"activityTabFullyLoaded","time":1508.8000001907349}],"measures":[],"correlationId":"2b2e789b02611b","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":92,"dbReadsTimeInMs":8,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}