Re: patch for passing the cts

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: patch for passing the cts
Дата
Msg-id 42AF6682.6000405@opencloud.com
обсуждение исходный текст
Ответ на patch for passing the cts  (Dave Cramer <pg@fastcrypt.com>)
Ответы Re: patch for passing the cts  (Dave Cramer <pg@fastcrypt.com>)
Список pgsql-jdbc
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

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: New italian translation
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: patch for passing the cts