Re: [HACKERS] Patching dblink.c to avoid warning about open transaction

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Patching dblink.c to avoid warning about open transaction
Дата
Msg-id 8978.1129484333@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Patching dblink.c to avoid warning about  (Joe Conway <mail@joeconway.com>)
Ответы Re: [HACKERS] Patching dblink.c to avoid warning about
Список pgsql-patches
Joe Conway <mail@joeconway.com> writes:
> Here is my counter-proposal to Bruce's dblink patch. Any comments?

Minor coding suggestion: to me it seems messy to do

> +     int       *openCursorCount = NULL;
> +     bool       *newXactForCursor = NULL;

> !         openCursorCount = &pconn->openCursorCount;
> !         newXactForCursor = &pconn->newXactForCursor;

> !         *newXactForCursor = TRUE;

This looks a bit cluttered already, and would get more so if you need to
add more fields to a remoteConn.  Plus it confuses the reader (at least
this reader) who is left wondering if you intend that those variables
might sometimes point to something other than two fields of the same
remoteConn.  I think it would be shorter and clearer to write

    remoteConn  *remconn = NULL;
    ...
    remconn = rconn;
    ...
    remconn->newXactForCursor = TRUE;

Also, you might be able to combine this variable with the existing
rconn local variable and thus simplify the code even more.

> Is it too late to apply this for 8.1? I tend to agree with calling this
> a bugfix.

I think it's reasonable to fix now, yes.

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] roundoff problem in time datatype
Следующее
От: Euler Taveira de Oliveira
Дата:
Сообщение: small typo