db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kathey Marsden <kmarsdende...@sbcglobal.net>
Subject Re: [VOTE] Support the ANSI-SQL standard BOOLEAN datatype.
Date Thu, 11 Aug 2005 19:22:30 GMT
Rick Hillegas wrote:

> I propose to close bug 499 by re-enabling the ANSI-SQL standard
> BOOLEAN datatype which was disabled before IBM  open-sourced Derby.
>
> A yes vote means that you want to re-enable the ANSI-SQL standard
> BOOLEAN datatype.
>
> A no vote means that you do NOT want Derby to support the ANSI-SQL
> standard BOOLEAN datatype.
>
-1  If it means that NetworkServer/client will report BOOLEAN columns as
SMALLINT. 

I think  this means that client will report ResultSet metadata
incorrectly,  and it getString and getObject will be affected and
perhaps other JDBC calls.
I'll gladly change my vote  if the client behavior will  be standard and
match embedded.     I looked at the latest DRDA spec  and still don't
see any mention of  BOOLEAN, so I don't know how we handle this. I don't
want to prevent BOOLEAN,  I think it would be great, but not if it means
we introduce bugs in client we can't fix.


Note the following code in  org.apache.derby.impl.drda.FdocaConstants:

mapJdbcTypeToDrdaType(int jdbcType, boolean nullable,
                                               int[] outlen)
....
             case JDBC30Translation.BOOLEAN:
            case java.sql.Types.BIT:
            case java.sql.Types.TINYINT:
            case java.sql.Types.SMALLINT:
                drdaType = FdocaConstants.DRDA_TYPE_NSMALL;


Here is an example of the kinds of differences you would see because of
this.

With embedded in ij
ij> select * from booltab;
B
-----
true
false

2 rows selected
ij>


With client  I think as things currently stand it will look something
like this.
ij>
ij> select * from booltab;
B
------
1
0

2 rows selected
ij>




Mime
View raw message