From ca71131eebba63809ceb86be033a264a5f0a1d79 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 6 Oct 2022 11:08:56 -0400 Subject: Introduce t_isalnum() to replace t_isalpha() || t_isdigit() tests. ts_locale.c omitted support for "isalnum" tests, perhaps on the grounds that there were initially no use-cases for that. However, both ltree and pg_trgm need such tests, and we do also have one use-case now in the core backend. The workaround of testing isalpha and isdigit separately seems quite inefficient, especially when dealing with multibyte characters; so let's fill in the missing support. Discussion: https://postgr.es/m/2548310.1664999615@sss.pgh.pa.us --- src/backend/utils/adt/tsquery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/utils/adt/tsquery.c') diff --git a/src/backend/utils/adt/tsquery.c b/src/backend/utils/adt/tsquery.c index f49e6bb1578..a206926042e 100644 --- a/src/backend/utils/adt/tsquery.c +++ b/src/backend/utils/adt/tsquery.c @@ -248,7 +248,7 @@ parse_or_operator(TSQueryParserState pstate) return false; /* it shouldn't be a part of any word */ - if (t_iseq(ptr, '-') || t_iseq(ptr, '_') || t_isalpha(ptr) || t_isdigit(ptr)) + if (t_iseq(ptr, '-') || t_iseq(ptr, '_') || t_isalnum(ptr)) return false; for (;;) -- cgit v1.2.3