pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: jdbc cts final diff for review
Date: Wed, 29 Jun 2005 13:17:33 +0000
Message-ID: <42C29F6D.4060001@opencloud.com> (raw)
In-Reply-To: <688EEEFD-78B1-4C09-8CE8-E17520725AA2@fastcrypt.com>
References: <688EEEFD-78B1-4C09-8CE8-E17520725AA2@fastcrypt.com>

Dave Cramer wrote:
> Attached is the patch for review. QueryExecutor is unchanged now.
> 
> The only iffy bit is where I check for the in parameter being bound  to 
> void type. It could be done in checkAllParametersSet
> 
> I'd like to commit this shortly.

Ok, comments from just reading the patch.. I like the approach much 
better than the previous one, but the details need some cleanup.

Rather than putting knowledge of parameter direction into ParameterList, 
how about just allowing access to the type OID, and the caller checks 
for Oid.VOID? Then the ParameterList interface changes less and the 
change to use a Parameter class is unnecessary as the list doesn't need 
to store a direction value.

If you must store a direction value in the list, then another array 
might be better than wrapping everything up in an object (generates less 
garbage overall). Also, there are a few places that return magic values 
for the direction that should be using the symbolic constants you've 
defined elsewhere.

The change to checkAllParametersSet to not check OUT parameters seems 
unnecessary -- won't OUT parameters be set to the (non-null) NULL_OBJECT 
anyway?

> !                     // this is here for the sole purpose of passing the cts
> !                     if ( columnType == Types.DOUBLE && functionReturnType[i] == Types.REAL )
> !                     {
> !                         // return it as a float
> !                         if ( callResult[i] != null)
> !                             callResult[i] = new Float(((Double)callResult[i]).floatValue());
> !                     }

We can't do that! If it's failing that's probably because we're not 
doing the necessary implicit typecasts required by the spec..

Please explain what's going on here:

> +         case Types.FLOAT:				// TODO: FLOAT and REAL were FLOAT8 for the cts

>       public void setFloat(int parameterIndex, float x) throws SQLException
>       {
>           checkClosed();
> !         bindLiteral(parameterIndex, Float.toString(x), Oid.FLOAT8);
>       }
>   

(the bind changed from Oid.FLOAT4 to Oid.FLOAT8..)

You seem to have reverted your earlier changes and put back the types/* 
classes -- why?

adjustParamIndex() should be removed entirely if it's now always a no-op.

Why is type translation for JDBC2 types only done in the JDBC3 code (in 
registerOutParameter)? -- shouldn't that be in the JDBC2 code?

There are a bunch of gratuitous changes to the test code that probably 
shouldn't be committed, e.g. in BatchExecuteTest:

> +         try
> +         {
> +             Class.forName("org.postgresql.Driver");
> +         }
> +         catch( Exception ex){}

similarly in many other test classes.

....

It might be an idea to break this up into "support new-style OUT 
parameters" and "other fixes necessary to pass the CTS" as currently 
it's quite unclear which is which..

-O



view thread (10+ messages)  latest in thread

Message-ID: <42C29F6D.4060001@opencloud.com>
Permalink:  ../42C29F6D.4060001@opencloud.com/
Also on:    postgresql.org/message-id/42C29F6D.4060001@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, pg@fastcrypt.com
  Subject: Re: jdbc cts final diff for review
  In-Reply-To: <42C29F6D.4060001@opencloud.com>
  References: <688EEEFD-78B1-4C09-8CE8-E17520725AA2@fastcrypt.com> <42C29F6D.4060001@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox