Re: Unicode normalization test broken output

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unicode normalization test broken output
Date: 2019-12-09 22:22:39
Message-ID: 16791.1575930159@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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);

An alternative fix would be to start using a PQExpBuffer, but
it's probably not quite worth that.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2019-12-09 22:27:01 Re: verbose cost estimate
Previous Message Tomas Vondra 2019-12-09 22:14:06 Re: verbose cost estimate