Re: Assert failure with ICU support

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Richard Guo <guofenglinux(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Assert failure with ICU support
Date: 2023-04-19 20:45:48
Message-ID: 3017542.1681937148@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Jeff Davis <pgsql(at)j-davis(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2023-04-20 00:15:41 Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files
Previous Message Jeff Davis 2023-04-19 20:31:17 Re: Assert failure with ICU support