Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6a3631e

Browse files
committed
Escape output of pg_amcheck test
The pg_amcheck test reports a skip message if the layout of the indexdoes not match expectations. That message includes the bytes thatwere expected and the ones that were found. But the found ones arearbitrary bytes, which can have funny effects on the terminal whenthey are printed. To avoid that, escape non-word characters beforeprinting.Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>Discussion:https://www.postgresql.org/message-id/flat/3f96f079-64e5-468a-8a19-cb481f0d31e5%40eisentraut.org
1 parent36578fa commit6a3631e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/bin/pg_amcheck/t/004_verify_heapam.pl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,11 @@ sub write_tuple
367367
{
368368
close($file);# ignore errors on close; we're exiting anyway
369369
$node->clean_node;
370-
planskip_all=>
371-
sprintf(
370+
planskip_all=>sprintf(
372371
"Page layout of index%d differs from our expectations: expected (%x,%x,\"%s\"), got (%x,%x,\"%s\")",
373-
$tupidx, 0xDEADF9F9, 0xDEADF9F9,"abcdefg",$a_1,$a_2,$b);
372+
$tupidx, 0xDEADF9F9, 0xDEADF9F9,"abcdefg",$a_1,$a_2,
373+
# escape non-word characters to avoid confusing the terminal
374+
$b =~s{(\W)}{ sprintf '\x%02x', ord($1)}aegr);
374375
exit;
375376
}
376377

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp