Re: libpq debug log

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: alvherre(at)alvh(dot)no-ip(dot)org
Cc: iwata(dot)aya(at)fujitsu(dot)com, k(dot)jamison(at)fujitsu(dot)com, tsunakawa(dot)takay(at)fujitsu(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: libpq debug log
Date: 2021-02-26 04:35:26
Message-ID: 20210226.133526.1714893400831320780.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 25 Feb 2021 21:04:00 -0300, Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote in
> This assert I added?
>
> > +static bool
> > +pqTraceMaybeBreakLine(int size, PGconn *conn)
> > +{
> > + Assert(conn->be_msg->length > 0);
>
> It breaks. Maybe there's a good reason, maybe there ain't, but in the
> meantime I just removed it.

The assertion contradicts the condition just below.

| Assert(conn->be_msg->length > 0);
|
| conn->be_msg->length -= size;
| if (conn->be_msg->length <= 0)

It seems to me that the assertion was inteded to be placed after
subtracting size, and the operator > is inteded to be >=.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-02-26 04:38:05 Re: libpq debug log
Previous Message Amit Kapila 2021-02-26 04:26:25 Re: [HACKERS] logical decoding of two-phase transactions