You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2010/04/15 11:18:51 UTC

[jira] Created: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
----------------------------------------------------------------------------

                 Key: DERBY-4615
                 URL: https://issues.apache.org/jira/browse/DERBY-4615
             Project: Derby
          Issue Type: Bug
          Components: JDBC
    Affects Versions: 10.5.3.0
            Reporter: Knut Anders Hatlen
            Assignee: Knut Anders Hatlen


The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.

Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12889928#action_12889928 ] 

Mamta A. Satoor commented on DERBY-4615:
----------------------------------------

Can't backport DERBY-2602 into 10.5 because it will change the behavior of client server product when we already have branches on top of the 10.5 codeline. Because of that, I had to change the test to not look for nanosec granularity after the merge of DERBY-4615 into 10.5 codeline. The changes for DERBY-4615 are now in 10.5 codeline


> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.5.3.1, 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887384#action_12887384 ] 

Mamta A. Satoor commented on DERBY-4615:
----------------------------------------

DERBY-2602 is not in the list of bugs identified for backport to 10.5 but I can look into backporting it so DERBY-4615 does not have the above failure after the merge. Please let me know if any one has any objection to backport of DERBY-2602.

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Mamta A. Satoor
>             Fix For: 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor resolved DERBY-4615.
------------------------------------

         Assignee: Knut Anders Hatlen  (was: Mamta A. Satoor)
    Fix Version/s: 10.5.3.1
       Resolution: Fixed

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.5.3.1, 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor reassigned DERBY-4615:
--------------------------------------

    Assignee: Mamta A. Satoor  (was: Knut Anders Hatlen)

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Mamta A. Satoor
>             Fix For: 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-4615.
---------------------------------------

    Fix Version/s: 10.6.0.0
       Resolution: Fixed

Thanks Bryan! All the regression tests passed.
Committed revision 934474.

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.6.0.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4615:
--------------------------------------

    Attachment: test.diff

Attached is a JUnit test case that exposes the bug. The test case calls a procedure that takes date, time and timestamp values in its input parameters and returns the exact same values through its output parameters. In the test, the getters and setters on the callable statement are called with different combinations of calendars with different time zones, and the test checks whether the correct translation between the time zones has been performed.

With the client driver, the test passes. With the embedded driver, only the part of the test that uses the local time zone passes.

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4615:
--------------------------------------

    Attachment: derby-4615-1a.diff

Currently, the problem is that EmbedCallableStatement defines getXXX(int,Calendar) in terms of getXXX(int), so the Calendar argument is lost. The attached patch turns this situation around. Now all the work is done in the getters that take a Calendar argument, and the Calendar-less getters just forward calls to them after adding the default Calendar instance to the argument list.

Now the new test case in CallableTest runs cleanly both with the embedded driver and the client driver. I've started a full regression test run.

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887119#action_12887119 ] 

Knut Anders Hatlen commented on DERBY-4615:
-------------------------------------------

I think this is expected on 10.5 because of DERBY-2602 (not backported).

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Mamta A. Satoor
>             Fix For: 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886243#action_12886243 ] 

Mamta A. Satoor commented on DERBY-4615:
----------------------------------------

I will work on backporting this one

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Mamta A. Satoor
>             Fix For: 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857314#action_12857314 ] 

Bryan Pendleton commented on DERBY-4615:
----------------------------------------

+1 to the suggestion that getXXX(int) should call getXXX(int, Calendar),
rather than the other way around. Thanks for cleaning this up!


> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Reopened: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

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

Kathey Marsden reopened DERBY-4615:
-----------------------------------


reopen for 10.5 back port

> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-4615) EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12886749#action_12886749 ] 

Mamta A. Satoor commented on DERBY-4615:
----------------------------------------

The derbyall suite ran fine after the merge. But for junit suite (I ran it twice and both the times, same failure), I get following error. Is this an expected failure and hence we just need to change the test?
1) testTimeAndDateWithCalendar(org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest)junit.framework.AssertionFailedError: nanos expected:<123456789> but was:<123456000>
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest.assertSameTimestamp(CallableTest.java:522)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest.testTimeAndDateWithCalendar(CallableTest.java:456)
        at org.apache.derbyTesting.functionTests.tests.jdbcapi.CallableTest.testTimeAndDateWithCalendar(CallableTest.java:412)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)
        at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
        at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
        at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
        at junit.extensions.TestSetup.run(TestSetup.java:23)


> EmbedCallableStatement ignores Calendar in getDate, getTime and getTimestamp
> ----------------------------------------------------------------------------
>
>                 Key: DERBY-4615
>                 URL: https://issues.apache.org/jira/browse/DERBY-4615
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.5.3.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Mamta A. Satoor
>             Fix For: 10.6.1.0
>
>         Attachments: derby-4615-1a.diff, test.diff
>
>
> The getDate(), getTime() and getTimestamp() methods in EmbedCallableStatement ignore the Calendar argument, and therefore give the wrong results if some other calendar than the default calendar is passed in. The client driver seems to do the right thing, though.
> Also note that none of these methods are ever called by any of the regression tests.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.