This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 239274 - com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '18446744073709551615' in column '5' is outside valid range for the datatype BIGINT.
Summary: com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '18446744073709551615' in...
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords: PATCH_AVAILABLE
: 153824 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-09 14:45 UTC by Exceptions Reporter
Modified: 2014-10-12 12:35 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 205878


Attachments
stacktrace (1.94 KB, text/plain)
2013-12-09 14:45 UTC, Exceptions Reporter
Details
proposed patch v1 (6.19 KB, patch)
2013-12-15 14:56 UTC, matthias42
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2013-12-09 14:45:56 UTC
This bug was originally marked as duplicate of bug 193414, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE 7.4 (Build 201310111528)
VM: Java HotSpot(TM) 64-Bit Server VM, 23.7-b01, Java(TM) SE Runtime Environment, 1.7.0_15-b03
OS: Windows 7

User Comments:
GUEST: Did a query for which the result includes a row that contained a column of type UNSIGNED BIGINT and its value was 18446744073709551615. From the MySQL reference (http://dev.mysql.com/doc/refman/5.5/en/integer-types.html) this value is within the acceptable range for an UNSIGNED BIGINT.




Stacktrace: 
com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '18446744073709551615' in column '5' is outside valid range for the datatype BIGINT.
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:0)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
   at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
   at com.mysql.jdbc.Util.getInstance(Util.java:386)
Comment 1 Exceptions Reporter 2013-12-09 14:45:58 UTC
Created attachment 142974 [details]
stacktrace
Comment 2 matthias42 2013-12-15 14:56:41 UTC
Created attachment 143190 [details]
proposed patch v1

The error message is misleading (it comes from the driver) - the driver is asked to return a long value und for that the value is to big. The attached patch fixes this by checking the range for the input case and tries to first get the value as long and if that fails, queries the value as string and converts that to BigInteger.

Unsigned values are not that common from all databases I have access to, only mysql supports them.
Comment 3 matthias42 2013-12-15 14:57:40 UTC
As a workaround you can use the SQL text interface and query like this:

select id, cast(id2 as char), a from t1;
Comment 4 Libor Fischmeistr 2013-12-18 09:29:33 UTC
Patch seems good to me. Thank you very much for it.

Patch applied: http://hg.netbeans.org/core-main/rev/4f6c95c942ce
Comment 5 Quality Engineering 2013-12-19 03:14:58 UTC
Integrated into 'main-silver', will be available in build *201312190002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4f6c95c942ce
User: Libor Fischmeistr <lfischmeistr@netbeans.org>
Log: #239274: com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '18446744073709551615' in column '5' is outside valid range for the datatype BIGINT.
Comment 6 matthias42 2014-10-12 12:35:30 UTC
*** Bug 153824 has been marked as a duplicate of this bug. ***