Re: Unicode normalization test broken output

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unicode normalization test broken output
Date: 2019-12-10 12:18:31
Message-ID: f8da0a2d-bca3-0c6a-e6be-499c6e53fb3e@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-12-09 23:22, Tom Lane wrote:
> Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com> writes:
>> There appear to be several off-by-more-than-one errors in norm_test.c
>> print_wchar_str(). Attached is a patch to fix this (and make the output
>> a bit prettier). Result afterwards:
>
> I concur that this looks broken and your patch improves it.
> But I'm not very happy about the remaining assumption that
> we don't have to worry about characters above U+FFFF. I'd
> rather see it allocate 11 bytes per allowed pg_wchar, and
> manage the string contents with something like
>
> p += sprintf(p, "U+%04X ", *s);

Good point. Fixed in attached patch.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
v2-0001-Fix-output-of-Unicode-normalization-test.patch text/plain 1.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2019-12-10 12:41:28 Re: about allow_system_table_mods and SET STATISTICS
Previous Message Tomas Vondra 2019-12-10 11:59:03 Re: xact_start for walsender & logical decoding not updated