db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David M. Gaskin (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DDLUTILS-152) Value out of range on an unsigned integer
Date Mon, 29 Jan 2007 14:47:50 GMT

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

David M. Gaskin commented on DDLUTILS-152:

Hi Thomas,

I am using the newest version of the driver.

I believe that the problem is a MySQL J/Connector and have submitted a 
bug report to MySQL.
I have sent you a separate E-Mail with the bug report.

In spite of the fact that J/Connector is at least inconsistent (Meta 
Data INTEGER but a java.lang.Long returned)
IMHO DdlUtils should handle the basic problem of unsigned data in DBMSes.


> 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.

View raw message