Re: AbstractJdbc2Array - another patch

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: AbstractJdbc2Array - another patch
Дата
Msg-id Pine.BSO.4.64.0710180401490.16749@leary.csoft.net
обсуждение исходный текст
Ответ на AbstractJdbc2Array - another patch  (Marek Lewczuk <newsy@lewczuk.com>)
Список pgsql-jdbc

On Thu, 11 Oct 2007, Marek Lewczuk wrote:

> Hello all,
> in the attachment you can find AbstractJdbc2Array with small patch (empty
> array was wrongly interpreted). Please test it and if possible add to cvs.
>

I've finally found some time to test this and...

1) It causes six failures in the regression tests, these need to be fixed.

2) It would be good to have new tests for this new functionality.

3) When determing if NULL in an array string is a null value, you need to
check the server version.  Prior to 8.2 an unadorned NULL is the text
"null", not an actual null value.

4) Shouldn't toString(PgArrayList) be PgArrayList.toString() ?

5) Your coding style is a little hard to read because you try to cram a
lot of code into a single line.  Clarity is valued more than compactness.

Ex1 (line 214)

  if (b != null && (b.length() > 0 || wasInsideString))
curArray.add(useObjects && !wasInsideString && b.equals("NULL") ? null :
b);

Ex2 (line 348)
oa[length++] = multi && v != null ? buildArray((PgArrayList) v, 0, -1) :
(v == null ? null : connection.getTimestampUtils().toTime(null, (String)
v));

6) I was unable to recursively retrieve multidimensional arrays as
ResultSets as I thought I should be able to do (in the attached test).
Shouldn't you retain an array as the base type for the top level of a
multi-dimensional array and expose a dimension at a time via each
ResultSet?

Kris Jurka

Вложения

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

Предыдущее
От: Guy Rouillier
Дата:
Сообщение: Re: Getting started with jdbc3 and eclipse
Следующее
От: Julius Stroffek
Дата:
Сообщение: Re: [BUGS] 'on insert do instead' rule with a where clause responds 'INSERT 0 0'