More on updates with first() vs absolute()

Поиск
Список
Период
Сортировка
От Rich Cullingford
Тема More on updates with first() vs absolute()
Дата
Msg-id 3E64A5C8.7050201@sysd.com
обсуждение исходный текст
Ответы Re: More on updates with first() vs absolute()
Список pgsql-jdbc
Good morning,
Yesterday I reported a crash in updateRow() when preceded by an
absolute(1) positioning call, when preceding it with first() worked. It
now seems the DB update was happening OK; the crash was a null pointer
exception at the line:

     rowBuffer[columnIndex] =
connection.getEncoding().encode(String.valueOf(valueObject));

of updateRowBuffer(). It appears the rowBuffer isn't being initialized
properly, and, sure enough, when you compare first() with absolute(),
the former has:

            rowBuffer = new byte[this_row.length][];
        System.arraycopy(this_row, 0, rowBuffer, 0,
this_row.length);

while the latter does not. Adding the initialization cures the crash.
There might be other locations needing the same patch.

If this is an acceptable patch, I'll be happy to submit it if someone
tells me how.  (It looks like a cvs diff to pgsql-jdbc is the desired
way, but I'm not clear how to do that: do I start with the current
pg-snapshot or something else?)

                               Rich Cullingford
                               System Detection, Inc.
                               5 W 19th St, NYC, NY 10010
                               rculling@sysd.com


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

Предыдущее
От: Ian McFarland
Дата:
Сообщение: Closing one connection closes all connections?
Следующее
От: Ian McFarland
Дата:
Сообщение: Closing one connection closes all connections?