Thread

Commits

  1. Fix missed case for builtin collation provider.

  1. Almost-bug: missed case for builtin collation provider

    Jeff Davis <pgsql@j-davis.com> — 2024-10-10T06:00:13Z

    pattern_char_isalpha() doesn't check for the PG_C_UTF8 builtin
    collation provider, and ends up falling through to isalpha() for
    characters in the ascii range.
    
    I don't think this is an actual correctness bug, because:
    
      (a) For all locales I tested on linux and mac, isalpha() has
    identical behavior for the ascii range.
      (b) To be an actual correctness bug, it would need to be a false
    negative; that is, to say that a character is not case-varying when it
    is. The only case-varying characters in the ascii range for PG_C_UTF8
    are [A-Za-z], and it seems unlikely that any locale would treat those
    as non-alphabetic.
    
    But I I think we should fix and backport to 17, because there's no
    reason we should be calling libc at all when using PG_C_UTF8, and it
    might cause an issue on some platform that I didn't test.
    
    Fix attached (slightly different on master and 17). I intend to commit
    soon.
    
    Regards,
    	Jeff Davis