Re: bugfix: invalid bit/varbit input causes the log file to be unreadable

From: Quan Zongliang <quanzongliang(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: bugfix: invalid bit/varbit input causes the log file to be unreadable
Date: 2020-06-29 10:45:47
Message-ID: b9b3ca53-5165-9a0e-7a44-3cf4c4d0a5e3@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Good.

I tested it, and it looks fine.

Thank you.

On 2020/6/29 1:10 上午, Tom Lane wrote:
> I wrote:
>> Even granting the premise, the proposed patch seems like a significant
>> decrease in user-friendliness for typical cases. I'd rather see us
>> make an effort to print one valid-per-the-DB-encoding character.
>> Now that we can rely on snprintf to count %s restrictions in bytes,
>> I think something like this should work:
>> errmsg("\"%.*s\" is not a valid binary digit",
>> pg_mblen(sp), sp)));
>> But the real problem is that this is only the tip of the iceberg.
>> You didn't even hit all the %c usages in varbit.c.
> I went through all the %c format sequences in the backend to see which
> ones could use this type of fix. There were not as many as I'd expected,
> but still a fair number. (I skipped cases where the input was coming from
> the catalogs, as well as some non-user-facing debug printouts.) That
> leads to the attached patch, which seems to do the job without breaking
> anything that works today.
>
> regards, tom lane
>
> PS: I failed to resist the temptation to improve some shoddy error
> messages nearby in pageinspect/heapfuncs.c.
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2020-06-29 10:52:15 Re: POC: postgres_fdw insert batching
Previous Message Fujii Masao 2020-06-29 10:34:03 Re: [Bug fix]There is the case archive_timeout parameter is ignored after recovery works.