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 "David M. Gaskin (JIRA)" <ji...@apache.org> on 2007/01/26 18:00:49 UTC

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

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.


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

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DDLUTILS-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468512 ] 

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

The problem is that if you map the column to a wider Java type, then you'll have problems when inserting too big values. There is no general solution that DdlUtils can provide, only the user can define which mapping is best (see DDLUTILS-86)

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


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

Posted by "David M. Gaskin (JIRA)" <ji...@apache.org>.
    [ 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.

Regards
   Dave.







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


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

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DDLUTILS-152?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Dudziak resolved DDLUTILS-152.
-------------------------------------

    Resolution: Won't Fix

In this case, the native type <-> JDBC type mapping to use has to be defined by the user using the native type override proposed for DdlUtils 1.1

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


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

Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
    [ 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.