Re: Escape output of pg_amcheck test - Mailing list pgsql-hackers

From Mark Dilger
Subject Re: Escape output of pg_amcheck test
Date
Msg-id 59e4f283-d04d-70b4-012f-6e18a38c8e54@gmail.com
Whole thread Raw
In response to Escape output of pg_amcheck test  (Peter Eisentraut <peter@eisentraut.org>)
Responses Re: Escape output of pg_amcheck test
List 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



pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock
Next
From: Mark Dilger
Date:
Subject: Re: Escape output of pg_amcheck test