Type:
Bug
Priority:
Critical
Resolution:
Fixed
Affects Version/s:
1.4.4 , 1.5.9 , 1.6.1 , 2.0.3 , 1.6.2
We have an environment where we are upgrading the driver from v1.1.8 to 1.6.1 where we are running into issues where a decimal value coming back on the result set does not get parsed as an integer on v1.6.1 (getInt). The previous behavior on 1.x was that the value would get rounded and be a valid integer.
For instance:
mysql> select 100/3 as test;
---------
---------
---------
1 row in set (0.00 sec)
When run through the Driver v1.6.1:
Exception in thread "main" java.lang.RuntimeException: java.sql.SQLException: Out of range value for column 'test' : value 33.3333 is not in Integer range
at ::
Caused by: java.sql.SQLException: Out of range value for column 'test' : value 33.3333 is not in Integer range
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.parseInt(SelectResultSet.java:3440)
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getInternalInt(SelectResultSet.java:1075)
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getInt(SelectResultSet.java:1054)
at org.mariadb.jdbc.internal.com.read.resultset.SelectResultSet.getInt(SelectResultSet.java:1061)
When run on Driver 1.x:
Results: 33.
Tested this on multiple versions > 1.x and it seems to be consistent with 1.6.1. The workaround i figured is to parse as Double or Float. However we have a lot of code to refactor if thats what is desired moving forward.
Note: This also affects getByte, getShort and getInt behavior. For instance a getByte against 1.0 = 1, whereas a getByte against 1.1 will be a similar out of range Exception for the byte range.
{"report":{"fcp":1219.0999999642372,"ttfb":442.7999999523163,"pageVisibility":"visible","entityId":61879,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"73b80b7c-770a-45ff-9233-8425a0841a3d","navigationType":0,"readyForUser":1290.5,"redirectCount":0,"resourceLoadedEnd":1173,"resourceLoadedStart":448.5,"resourceTiming":[{"duration":296.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":448.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":448.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":745,"responseStart":0,"secureConnectionStart":0},{"duration":296.5999999642372,"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":448.69999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":448.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":745.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":305.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":448.89999997615814,"connectEnd":448.89999997615814,"connectStart":448.89999997615814,"domainLookupEnd":448.89999997615814,"domainLookupStart":448.89999997615814,"fetchStart":448.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":448.89999997615814,"responseEnd":754.3999999761581,"responseStart":754.3999999761581,"secureConnectionStart":448.89999997615814},{"duration":348.30000001192093,"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":449.0999999642372,"connectEnd":449.0999999642372,"connectStart":449.0999999642372,"domainLookupEnd":449.0999999642372,"domainLookupStart":449.0999999642372,"fetchStart":449.0999999642372,"redirectEnd":0,"redirectStart":0,"requestStart":449.0999999642372,"responseEnd":797.3999999761581,"responseStart":797.3999999761581,"secureConnectionStart":449.0999999642372},{"duration":352.4000000357628,"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":449.2999999523163,"connectEnd":449.2999999523163,"connectStart":449.2999999523163,"domainLookupEnd":449.2999999523163,"domainLookupStart":449.2999999523163,"fetchStart":449.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":449.2999999523163,"responseEnd":801.6999999880791,"responseStart":801.6999999880791,"secureConnectionStart":449.2999999523163},{"duration":352.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":449.5,"connectEnd":449.5,"connectStart":449.5,"domainLookupEnd":449.5,"domainLookupStart":449.5,"fetchStart":449.5,"redirectEnd":0,"redirectStart":0,"requestStart":449.5,"responseEnd":802.2999999523163,"responseStart":802.2999999523163,"secureConnectionStart":449.5},{"duration":353.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":449.5999999642372,"connectEnd":449.5999999642372,"connectStart":449.5999999642372,"domainLookupEnd":449.5999999642372,"domainLookupStart":449.5999999642372,"fetchStart":449.5999999642372,"redirectEnd":0,"redirectStart":0,"requestStart":449.5999999642372,"responseEnd":802.6999999880791,"responseStart":802.6999999880791,"secureConnectionStart":449.5999999642372},{"duration":449.5,"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":449.89999997615814,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":449.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":899.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":353.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":450,"connectEnd":450,"connectStart":450,"domainLookupEnd":450,"domainLookupStart":450,"fetchStart":450,"redirectEnd":0,"redirectStart":0,"requestStart":450,"responseEnd":803.2999999523163,"responseStart":803.2999999523163,"secureConnectionStart":450},{"duration":449.39999997615814,"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":450.19999998807907,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":450.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":899.5999999642372,"responseStart":0,"secureConnectionStart":0},{"duration":353.60000002384186,"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":450.2999999523163,"connectEnd":450.2999999523163,"connectStart":450.2999999523163,"domainLookupEnd":450.2999999523163,"domainLookupStart":450.2999999523163,"fetchStart":450.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":450.2999999523163,"responseEnd":803.8999999761581,"responseStart":803.7999999523163,"secureConnectionStart":450.2999999523163},{"duration":489.5,"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":455.7999999523163,"connectEnd":455.7999999523163,"connectStart":455.7999999523163,"domainLookupEnd":455.7999999523163,"domainLookupStart":455.7999999523163,"fetchStart":455.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":455.7999999523163,"responseEnd":945.2999999523163,"responseStart":945.2999999523163,"secureConnectionStart":455.7999999523163},{"duration":502.2000000476837,"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":457.2999999523163,"connectEnd":457.2999999523163,"connectStart":457.2999999523163,"domainLookupEnd":457.2999999523163,"domainLookupStart":457.2999999523163,"fetchStart":457.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":457.2999999523163,"responseEnd":959.5,"responseStart":959.5,"secureConnectionStart":457.2999999523163},{"duration":32.10000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":927.7999999523163,"connectEnd":927.7999999523163,"connectStart":927.7999999523163,"domainLookupEnd":927.7999999523163,"domainLookupStart":927.7999999523163,"fetchStart":927.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":927.7999999523163,"responseEnd":959.8999999761581,"responseStart":959.8999999761581,"secureConnectionStart":927.7999999523163},{"duration":209.70000004768372,"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":963.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":963.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1173,"responseStart":0,"secureConnectionStart":0}],"fetchStart":1,"domainLookupStart":1,"domainLookupEnd":1,"connectStart":1,"connectEnd":1,"requestStart":285,"responseStart":443,"responseEnd":457,"domLoading":447,"domInteractive":1349,"domContentLoadedEventStart":1349,"domContentLoadedEventEnd":1398,"domComplete":2045,"loadEventStart":2045,"loadEventEnd":2046,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1321.3999999761581},{"name":"bigPipe.sidebar-id.end","time":1322.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.start","time":1322.5},{"name":"bigPipe.activity-panel-pipe-id.end","time":1324.7999999523163},{"name":"activityTabFullyLoaded","time":1419.0999999642372}],"measures":[],"correlationId":"fec0ac9b932144","effectiveType":"4g","downlink":9.9,"rtt":0,"serverDuration":101,"dbReadsTimeInMs":13,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Snapshot for version 1.6 : (1.6.3-SNAPSHOT) now available with this correction :
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
</dependency>
</dependencies>
1.6.3 and 2.1.0 release date is 2017-07-31 (https://jira.mariadb.org/plugins/servlet/project-config/CONJ/administer-versions?&status=unreleased)