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.
Summary: | com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '2.14748365E9' in column '1' is outside valid range for the datatype INTEGER. | ||
---|---|---|---|
Product: | db | Reporter: | matthias42 |
Component: | Show Data | Assignee: | Jiri Rechtacek <jrechtacek> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jkovalsky |
Priority: | P3 | Keywords: | NETFIX |
Version: | 7.0 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | 163877 |
Attachments: |
stacktrace
Patch for the reading part Patch for reading and writing |
Description
matthias42
2010-12-14 21:09:14 UTC
Created attachment 104095 [details]
stacktrace
Created attachment 104173 [details]
Patch for the reading part
This seems to be related to mysql reporting an UNSIGNEND INT Column as SQL-Type INTEGER. According to the JDBC Spec the default map of this type is int, but this only works for SIGNED INTEGER Columns.
My proposal would be to change the mapping in DBReadWriteHelper.java for the INTEGER, SMALLINT and TINYINT to switch to the next bigger datatype (short -> int -> long).
The attached patches fixes at least the reading side and should work.
Created attachment 104175 [details]
Patch for reading and writing
The attached patches works for me as expected. It unifies the handling of the datatypes (TINYINT, SMALLINT, INT). The verification is more lax with respect to values in the range MAX_DATATYPE + 1 to (2 * MAX_DATATYPE - 1).
This can serve as a test-case against a mysql database: drop table t2; CREATE TABLE `t2` ( `id` int(11) NOT NULL auto_increment, t int unsigned, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; insert into t2 (t) VALUES (2147483680); select * from t2; Run in the db dataview in Netbeans 6.9.1 (unpatched) reuslts in this message: Error code 0, SQL state 22003: '2.14748368E9' in column '2' is outside valid range for the datatype INTEGER. Run in the db dataview in my patched Netbeans 7-beta installation, I get the expected listing. matthias, thanks a lot for the patch, has been applied in core-main/rev/20b9e61ffa15 changeset. Ccing Jirka, Jirka, please add this fix into list of community contributions. Integrated into 'main-golden', will be available in build *201101290000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/20b9e61ffa15 User: Jiri Rechtacek <jrechtacek@netbeans.org> Log: #193414: com.mysql.jdbc.exceptions.jdbc4.MySQLDataException: '2.14748365E9' in column '1' is outside valid range for the datatype INTEGER; applied matthias42's patch Thanks guys. Added to list [1] of community fixed bugs. Great job Matthias! [1] http://wiki.netbeans.org/NetFIXIssues I'm sorry but i don't know how to apply the patch to netbeans! |