Re: patch for passing the cts

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: patch for passing the cts
Date: 2005-06-15 00:40:11
Message-ID: EB3B2C5E-9B58-44F8-8FD8-A23407F9EEA9@fastcrypt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Oliver,

So if we defer parsing, this will require changing the strategy to
create the parameters as they are set, or registered.

I would suggest using an ArrayList of Parameters, and grow this as
required, then parse when it is executed.

Do you have any suggestions ?

Dave
On 14-Jun-05, at 7:21 PM, Oliver Jowett wrote:

> Dave Cramer wrote:
>
>> Well the good news is that the driver and the backend will pass
>> the cts
>> with this patch.
>>
>> Rather than commit this as is, I'd like to discuss the patch as it
>> is.
>>
>> I'm really not happy with the handling of IN/OUT parameters in the
>> query executor, however deferring parsing doesn't seem to be an
>> option
>> either.
>>
>
> I don't think your approach works, though; consider this (untested)
> example:
>
> CallableStatement cs = conn.prepareCall("{call f(?*4,?)}");
> cs.setInt(1,42);
> cs.registerOutParameter(2,Types.INTEGER);
>
> The query gets parsed into these fragments:
>
> 0:"select * from f("
> 1:"*4,"
> 2:") as result"
>
> As I read your code, that's going to discard fragment 1 blindly in the
> query executor, resulting in this query:
>
> "select * from f($1) as result"
>
> which is wrong.
>
> The logic that decides to remove OUT placeholders needs to be aware of
> the rest of the {call} structure (mainly, comma separation of
> parameters) to do it correctly, and I really don't think that the
> QueryExecutor implementations are the right place for that..
>
> -O
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2005-06-15 01:58:43 Re: patch for passing the cts
Previous Message Oliver Jowett 2005-06-14 23:21:38 Re: patch for passing the cts