Informix - Problem description
Problem IC68117 | Status: Closed |
INCORRECT DATA IS RETURNED INTO SMALLINT WHEN SETOBJECT USED WITH LARGE NUMBERS. AN EXCEPTION AND/OR ERROR 1214 SHOULD BE THROWN | |
product: | |
IBM JDBC / 5724I3501 / 350 - Informix 3.50 | |
Problem description: | |
An Exception should be thrown when setObject is used to attempt to insert a large number into smallint column . Instead, incorrect or truncated data is inserted which is not correct This is a defect in the Informix JDBC Driver noticed for the following scenarios preparedStatement with setObject preparedStatement with setObject and Type SMALLINT An exception and a 1214 error is thrown correctly for the preparedStatement with setInt scenario . For example $ java bad preparedStatement with setInt java.sql.SQLException: Value exceeds limit of SMALLINT precision at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408) at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3508) at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3821) at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2627) at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2543) at com.informix.jdbc.IfxSqli.executeCommand(IfxSqli.java:940) at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:300) at com.informix.jdbc.IfxStatement.c(IfxStatement.java:1272) at com.informix.jdbc.IfxPreparedStatement.executeUpdate(IfxPrepared Statement.java:415) at bad.do_sql(bad.java:114) at bad.main(bad.java:29) Caused by: java.sql.SQLException at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:408) at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3826) ... 8 more A similar exception needs to be thrown for the preparedStatement with setObject preparedStatement with setObject and Type SMALLINT scenarios also Instead incorrect or truncated data can get inserted into a smallint column | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Users using the Informix-JDBC 3.50xC6 or lower and using * * large values to insert into SmallInt column * **************************************************************** * PROBLEM DESCRIPTION: * * Exception is not being thrown when setObject is used to * * attempt to insert values larger than the range of smallInt * * into smallint. * **************************************************************** * RECOMMENDATION: * * Upgrade to version 3.50.xC7 or higher or please contact tech * * support for a patch for the fix. * **************************************************************** | |
Local Fix: | |
Solution | |
A check is applied after the data type conversion to check for precision loss. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 22.04.2010 06.10.2010 06.10.2010 |
Problem solved at the following versions (IBM BugInfos) | |
3.50.xC7 | |
Problem solved according to the fixlist(s) of the following version(s) | |
11.50.xC8 |
![]() |