Re: Problem with insert - 1.12.0 RC1

Поиск
Список
Период
Сортировка
От Guillaume Lelarge
Тема Re: Problem with insert - 1.12.0 RC1
Дата
Msg-id 4C7F8AD0.2080204@lelarge.info
обсуждение исходный текст
Ответ на Re: Problem with insert - 1.12.0 RC1  (Dave Page <dpage@pgadmin.org>)
Ответы Re: Problem with insert - 1.12.0 RC1  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-hackers
Le 02/09/2010 10:28, Dave Page a écrit :
> On Thu, Sep 2, 2010 at 9:16 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> In pgadmin/db/pgConn.cpp, method ExecuteSet, the line "return 0;" is
>> replaced with "return new pgSet();". It fouls the frmEditGrid window,
>> which thinks it has a valid return, and displays an empty line. I have
>> no idea why this was changed. ExecuteSet doesn't seem to be used in the
>> rest of the patch. Dave, can you comment on this please? should we
>> revert this line to what it was before the patch?
>
> I honestly don't recall what the rationale for the change was. My
> *suspicion* is that it was needed to ensure that we get sane behaviour
> from all the places that might be calling ExecuteSet in the face of a
> failure. Previously, all those objects would break horribly but be
> immediately destroyed by the disconnect. Now, they need to survive in
> a reasonable state so the connection can be re-established.
>
> My bad for not commenting on it - sometime these things seem so
> obvious at the time :-(
>

We surely don't comment enough the code.

> Anyway, can the code in the edit grid be modified to detect the empty
> pgSet in place of null?
>

Yeah, by checking how many rows were inserted. See patch attached. It
fixes the issue. Not sure this is the way we should do it. I'm afraid
there are other parts in the code where the "return new pgSet();" code
will bite us.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Вложения

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

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: Problem with insert - 1.12.0 RC1
Следующее
От: Dave Page
Дата:
Сообщение: Re: Problem with insert - 1.12.0 RC1