mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
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
This commit is contained in:
@ -126,7 +126,7 @@ typedef struct
|
||||
|
||||
#define LQUERY_HASNOT 0x01
|
||||
|
||||
#define ISALNUM(x) ( t_isalpha(x) || t_isdigit(x) || ( pg_mblen(x) == 1 && t_iseq((x), '_') ) )
|
||||
#define ISALNUM(x) ( t_isalnum(x) || ( pg_mblen(x) == 1 && t_iseq((x), '_') ) )
|
||||
|
||||
/* full text query */
|
||||
|
||||
|
Reference in New Issue
Block a user