db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4965) Boolean to char conversion results in integer
Date Mon, 24 Jan 2011 12:11:45 GMT

     [ https://issues.apache.org/jira/browse/DERBY-4965?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Knut Anders Hatlen updated DERBY-4965:

    Issue & fix info: [Release Note Needed, Repro attached]  (was: [Repro attached, Patch
       Fix Version/s:

Thanks for looking at the patch, Dag. Committed revision 1062743.

I agree that a release note would be in order, so I've checked the Release Note Needed check
box and will keep the issue open until one has been attached.

I forgot to mention one change I made in the patch. I changed a comment in CrossConverters.java
as shown below:

     // Convert from boolean source to target type.
     // In support of PS.setBoolean().
-    // See differences.html for DNC setBoolean() semantics.
     final Object setObject(int targetType, boolean source) throws SqlException {

I didn't find any document named differences.html, nor any other document mentioning DNC setBoolean()
semantics, so I removed that reference. Does anyone know which document the comment is talking
about? We may need to update the document if it exists.

> Boolean to char conversion results in integer
> ---------------------------------------------
>                 Key: DERBY-4965
>                 URL: https://issues.apache.org/jira/browse/DERBY-4965
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>             Fix For:
>         Attachments: derby-4965-1a.diff, derby-4965-1b.diff, derby-4965-1c.diff
> Seen when running the Java EE CTS on Derby The following code results in "1"
being printed, whereas the expected result is "true":
>         PreparedStatement ps = c.prepareStatement("values cast(? as char(10))");
>         ps.setObject(1, Boolean.TRUE, Types.CHAR);
>         ResultSet rs = ps.executeQuery();
>         rs.next();
>         System.out.println(rs.getString(1));
> Same seen when using VARCHAR or LONGVARCHAR instead of CHAR, and when using setBoolean()
instead of setObject().

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

View raw message