db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-4889) Different byte to boolean conversion on embedded and client
Date Mon, 08 Nov 2010 15:46:24 GMT

    [ https://issues.apache.org/jira/browse/DERBY-4889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929599#action_12929599
] 

Rick Hillegas commented on DERBY-4889:
--------------------------------------

Thanks for finding this bug, Knut. I can confirm this behavior also with the following INSERT
statement where column A has type BOOLEAN:

insert into t( a ) values ( ? )

For the client, the following calls insert TRUE:

ps.setInt( 1, 32 );
ps.setLong( 1, 32 );
ps.setObject( 1, new Integer( 32 ) );
ps.setObject( 1, new Long( 32L ) );

but the following calls insert FALSE:

ps.setByte( 1, (byte) 32 );
ps.setByte( 1, (short) 32 );
ps.setObject( 1, new Byte( (byte) 32 ) );
ps.setObject( 1, new Short( (short) 32 ) );

All calls insert TRUE in the embedded case.

> Different byte to boolean conversion on embedded and client
> -----------------------------------------------------------
>
>                 Key: DERBY-4889
>                 URL: https://issues.apache.org/jira/browse/DERBY-4889
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.7.1.0
>            Reporter: Knut Anders Hatlen
>
> The following code prints "true" with the embedded driver and "false" with the client
driver:
>         PreparedStatement ps = c.prepareStatement("values cast(? as boolean)");
>         ps.setByte(1, (byte) 32);
>         ResultSet rs = ps.executeQuery();
>         rs.next();
>         System.out.println(rs.getBoolean(1));
> If setByte() is replaced with setInt(), they both print "true".

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


Mime
View raw message