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

Knut Anders Hatlen updated DERBY-4965:
--------------------------------------

    Attachment: derby-4965-1b.diff

Attaching a new patch (1b) that addresses the issues with the 1a patch.

Description of the changes:

M       java/engine/org/apache/derby/iapi/types/SQLChar.java

Use true/false when setting the value of an SQLChar from a boolean.

M       java/drda/org/apache/derby/impl/drda/DRDAConnThread.java

Let the server know what to do if it gets a parameter of type 
DRDA_TYPE_NBOOLEAN from the client.

M       
java/testing/org/apache/derbyTesting/functionTests/tests/lang/NullIfTest.java
M       
java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java

Make the tests expect "true" instead of "1" when setting a character type value 
from a boolean.

M       java/client/org/apache/derby/client/net/NetStatementRequest.java

Handle BIT values as BOOLEAN instead of SMALLINT. Send BIT/BOOLEAN as boolean 
to the server, if it knows how to handle it (above mentioned fix in 
DRDAConnThread.java is required).

M       java/client/org/apache/derby/client/am/CrossConverters.java

Add cross conversion rules for conversions from boolean to the various other 
types (for setObject() with type argument).

M       java/client/org/apache/derby/client/am/DatabaseMetaData.java

Add new method that tells whether the server understands boolean parameter 
value (that is, if it has the above mentioned fix in DRDAConnThread.java).

Derbyall, suites.All and the client/server compatibility tests ran cleanly with 
the patch.

> 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: 10.7.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: derby-4965-1a.diff, derby-4965-1b.diff
>
>
> Seen when running the Java EE CTS on Derby 10.7.1.1. 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.

Reply via email to