pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Richard Guo <guofenglinux@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: Assert failure with ICU support
Date: Wed, 19 Apr 2023 16:45:48 -0400
Message-ID: <3017542.1681937148@sss.pgh.pa.us> (raw)
In-Reply-To: <ece303a3068026c6d6f10cab2a7f3f0836f4adb7.camel@j-davis.com>
References: <CAMbWs49Q6UoKGeT8pBkMtJGJd+16CBFZaaWUk9Du+2ERE5g_YA@mail.gmail.com>
	<ece303a3068026c6d6f10cab2a7f3f0836f4adb7.camel@j-davis.com>

Jeff Davis <pgsql@j-davis.com> writes:
> We should probably just check that it's plain ASCII.

That was about the same conclusion I came to.  More or less

	c = *v->now++;
-	if (!iscalnum(c))
+	if (!isascii(c) || !iscalnum(c))
		RETV(PLAIN, c);

although I'm not sure if it's a good idea to apply isascii()
to something that's wider than char.  It might be advisable,
if ugly, to write

+	if (c >= 0x100 || !iscalnum(c))

I'm also inclined to remove that "assert(iscalpha(c))" in
the switch.  That's not checking sanity of our own code,
just consistency of the <wctype.h> functions; and as this
episode shows it's more trouble than it's worth.

			regards, tom lane





view thread (8+ messages)  latest in thread

Message-ID: <3017542.1681937148@sss.pgh.pa.us>
Permalink:  ../3017542.1681937148@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3017542.1681937148@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com, guofenglinux@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: Assert failure with ICU support
  In-Reply-To: <3017542.1681937148@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox