[teiid-issues] [JBoss JIRA] (TEIID-2246) Incorrect results with TIMESTAMPDIFF
Van Halbert (JIRA)
jira-events at lists.jboss.org
Fri Oct 5 14:17:02 EDT 2012
[ https://issues.jboss.org/browse/TEIID-2246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12724470#comment-12724470 ]
Van Halbert edited comment on TEIID-2246 at 10/5/12 2:16 PM:
-------------------------------------------------------------
After doing some testing on the 7.4.x branch, it appears there's an overflow issue. I'll attach 2 patches that do:
- use some suggested code that test for overflow
- added unit tests that confirms the above issue
When running the tests, you should see 3 error:
Tests in error:
testTimestampDiffTimeStamp_ErrorUsingEndDate(org.teiid.query.function.TestFunction): Long overflow
testTimestampDiffTimeStamp_ErrorUsingEndDate2304(org.teiid.query.function.TestFunction): Long overflow
testTimestampDiffTimeStamp_ErrorUsingEndDate2262(org.teiid.query.function.TestFunction): Long overflow
The one added test: testTimestampDiffTimeStamp_ErrorUsingEndDate2261 was the determined boundary before 2262 starts producing the problem
was (Author: van.halbert):
After doing some testing on the 7.4.x branch, it appears there's an overflow issue. I'll attach 2 patches that do:
- use some suggested code that test for overflow
- added unit tests that confirms the above issue
> Incorrect results with TIMESTAMPDIFF
> ------------------------------------
>
> Key: TEIID-2246
> URL: https://issues.jboss.org/browse/TEIID-2246
> Project: Teiid
> Issue Type: Bug
> Components: Server
> Affects Versions: 7.4.4
> Reporter: Van Halbert
> Assignee: Johnathon Lee
> Attachments: TestFunction.java.patch
>
>
> 2 issues with TIMESTAMPDIFF:
> 1.
> select TIMESTAMPDIFF(SQL_TSI_DAY,parseDate('2012-01-01', 'yyyy-MM-dd'),parseDate('2304-04-12', 'yyyy-MM-dd'));
> result = 106751
> If you increase the end date by 1 day:
> select TIMESTAMPDIFF(SQL_TSI_DAY,parseDate('2012-01-01', 'yyyy-MM-dd'),parseDate('2304-04-13', 'yyyy-MM-dd'))
> result = -106751. I would expected the answer to be 106752
> 2. Both MS Excel and Oracle give the number of days between 1-Jan-2012 and 12-Apr-2304 as 106752, not the 106751 that EDS is reporting.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the teiid-issues
mailing list