You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Thomas Dudziak (JIRA)" <ji...@apache.org> on 2007/01/26 23:28:49 UTC

[jira] Commented: (DDLUTILS-152) Value out of range on an unsigned integer

    [ https://issues.apache.org/jira/browse/DDLUTILS-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467940 ] 

Thomas Dudziak commented on DDLUTILS-152:
-----------------------------------------

DdlUtils relies on the JDBC driver to provide a correct mapping (native -> JDBC type), but in this case, the JDBC driver seems to report a wrong type. Could you try a newer driver (if one exists) ?

> Value out of range on an unsigned integer
> -----------------------------------------
>
>                 Key: DDLUTILS-152
>                 URL: https://issues.apache.org/jira/browse/DDLUTILS-152
>             Project: DdlUtils
>          Issue Type: Bug
>          Components: Core - MySql
>         Environment: Windows XP
>            Reporter: David M. Gaskin
>         Assigned To: Thomas Dudziak
>
> The column (number 2) is defined (in a MySQL database) as:
> IP_FROM int unsigned
> The stack trace is at the end of this description.
> The problem probably occurs on all databases that have any data type of 
> (tinyint/smallint/mediumint/integer/bigint) unsigned
> The problem also occurs in the XML Schema, example:
> MySQL DDL is "IP_FROM int unsigned" that is mapped to:
>       <column name="IP_FROM" primaryKey="false" required="true" type="INTEGER" size="10" default="0000000000" autoIncrement="false"/>
> Unsigned numeric data has to be promoted to the next larger java numeric type i.e.
> (unsigned) byte -> short
> (unsigned) short -> int
> (unsigned) int -> long
> (unsigned) long -> ???
> I use java.math.BigInteger for unsigned long in java.
> .
> Exception in thread "main" org.apache.ddlutils.DatabaseOperationException: Exception while reading the row from the resultset
> 	at org.apache.ddlutils.platform.ModelBasedResultSetIterator.next(ModelBasedResultSetIterator.java:263)
> 	at org.apache.ddlutils.io.DataWriter.write(DataWriter.java:368)
> 	at org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:448)
> 	at org.apache.ddlutils.io.DatabaseDataIO.writeDataToXML(DatabaseDataIO.java:316)
> 	at de.gaskin.db.ddlutils.test.MySQLDump1.<init>(MySQLDump1.java:30)
> 	at de.gaskin.db.ddlutils.test.MySQLDump1.main(MySQLDump1.java:34)
> Caused by: com.mysql.jdbc.exceptions.MySQLDataException: '2.147483648E9' in column '2' is outside valid range for the datatype INTEGER.
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:893)
> 	at com.mysql.jdbc.ResultSet.throwRangeException(ResultSet.java:7391)
> 	at com.mysql.jdbc.ResultSet.parseIntAsDouble(ResultSet.java:6710)
> 	at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2478)
> 	at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:2570)
> 	at org.apache.ddlutils.platform.PlatformImplBase.extractColumnValue(PlatformImplBase.java:2098)
> 	at org.apache.ddlutils.platform.PlatformImplBase.getObjectFromResultSet(PlatformImplBase.java:2021)
> 	at org.apache.ddlutils.platform.ModelBasedResultSetIterator.next(ModelBasedResultSetIterator.java:253)
> 	... 5 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.