Well, it does seem that DRDA does *not* support (SQL-99) Boolean datatype - I looked at the specs and did not see it - hence the mapping from boolean to small integer in the code snippet hilighted by Kathey. Unless there is a way to expand the DRDA metadata somehow to specify that this is a boolean type and do the conversion appropriately on the other side, it could be tricky - Would like to find out of the Open Group intends to support this datatype at some point and conform to SQL-99 _or_ is it indeed the correct and expected behavior when the database engine supports boolean datatype - In other words, wouldn't the discrepancy behavior be the same with the current DRDA driver against another database system supporting column of boolean datatype? I would think so...
--francois On 8/11/05, Kathey Marsden <[EMAIL PROTECTED]> wrote: > 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> > > > >
