Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ieRQV-0005EZ-OA for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2019 22:22:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ieRQU-0000ga-0O for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Dec 2019 22:22:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ieRQT-0000gT-Ni for pgsql-hackers@lists.postgresql.org; Mon, 09 Dec 2019 22:22:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ieRQR-0007pK-H2 for pgsql-hackers@postgresql.org; Mon, 09 Dec 2019 22:22:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xB9MMdI2016792; Mon, 9 Dec 2019 17:22:39 -0500 From: Tom Lane To: Peter Eisentraut cc: pgsql-hackers Subject: Re: Unicode normalization test broken output In-reply-to: <6a7a8516-7d11-8fbd-0e8b-eadb4f0679eb@2ndquadrant.com> References: <6a7a8516-7d11-8fbd-0e8b-eadb4f0679eb@2ndquadrant.com> Comments: In-reply-to Peter Eisentraut message dated "Mon, 09 Dec 2019 12:05:30 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16790.1575930159.1@sss.pgh.pa.us> Date: Mon, 09 Dec 2019 17:22:39 -0500 Message-ID: <16791.1575930159@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Peter Eisentraut 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