Re: Escape output of pg_amcheck test

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Escape output of pg_amcheck test
Date: 2024-01-08 13:41:02
Message-ID: 59e4f283-d04d-70b4-012f-6e18a38c8e54@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 1/7/24 23:27, Peter Eisentraut wrote:
> The pg_amcheck reports a skip message if the layout of the index does
> not match expectations.  That message includes the bytes that were
> expected and the ones that were found.  But the found ones are arbitrary
> bytes, which can have funny effects on the terminal when they are
> printed.  To avoid that, escape non-word characters before printing.

> + # escape non-word characters to avoid confusing the terminal
> + $b =~ s{(\W)}{ sprintf '\x%02x', ord($1) }aegr);

The /r modifier defeats the purpose of the patch, at least for my perl
version, perl 5, version 28, subversion 1 (v5.28.1). With just the /aeg
modifier, it works fine.

--
Mark Dilger

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2024-01-08 13:52:26 Re: Escape output of pg_amcheck test
Previous Message Dilip Kumar 2024-01-08 13:18:09 Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock