[
https://issues.apache.org/jira/browse/DERBY-2386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12477050
]
Don Smith commented on DERBY-2386:
----------------------------------
Stack trace:
Caused by: java.sql.SQLException: The resulting value is outside the range for
the data type INTEGER.
at
org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
at org.apache.derby.client.am.SqlException.getSQLException(Unknown
Source)
at org.apache.derby.client.am.PreparedStatement.executeQuery(Unknown
Source)
at
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1775)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2208)
... 38 more
Caused by: org.apache.derby.client.am.SqlException: The resulting value is
outside the range for the data type INTEGER.
at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
at org.apache.derby.client.am.Statement.completeOpenQuery(Unknown
Source)
at
org.apache.derby.client.net.NetStatementReply.parseOpenQueryFailure(Unknown
Source)
at
org.apache.derby.client.net.NetStatementReply.parseOPNQRYreply(Unknown Source)
at org.apache.derby.client.net.NetStatementReply.readOpenQuery(Unknown
Source)
at org.apache.derby.client.net.StatementReply.readOpenQuery(Unknown
Source)
at org.apache.derby.client.net.NetStatement.readOpenQuery_(Unknown
Source)
at org.apache.derby.client.am.Statement.readOpenQuery(Unknown Source)
at org.apache.derby.client.am.PreparedStatement.flowExecute(Unknown
Source)
at org.apache.derby.client.am.PreparedStatement.executeQueryX(Unknown
Source)
... 44 more
> timestampdiff function fails when using SQL_TSI_FRAC_SECOND for datepart
> parameter, except for very small intervals
> -------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2386
> URL: https://issues.apache.org/jira/browse/DERBY-2386
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.2.2.0
> Environment: SUSE Linux Enterprise Desktop 10
> Reporter: Don Smith
>
> Using the timestampdiff function produces and integer overflow except for
> very small intervals. Error message is:
> [Error Code: -1, SQL State: 22003] The resulting value is outside the range
> for the data type INTEGER.
> I inserted the following row into my test table:
> insert into datetest (ID,
> startdate,
> enddate) values (
> 5,
> '2006-11-20 04:20:00.0',
> '2006-11-20 04:20:00.2');
> This test row works:
> select {fn timestampdiff(SQL_TSI_FRAC_SECOND, startdate, enddate)} as diff
> from datetest where id = 5
> DIFF
> 200000000
> The value also looks too large, which could be exacerbating the problem.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.