pgsql: Fix text substring search for non-deterministic collations.

2025-12-05 Thread Tom Lane
Fix text substring search for non-deterministic collations. Due to an off-by-one error, the code failed to find matches at the end of the haystack. Fix by rewriting the loop. While at it, fix a comment that claimed that the function could find a zero-length match. Such a match could send a call

pgsql: Fix text substring search for non-deterministic collations.

2025-12-05 Thread Tom Lane
Fix text substring search for non-deterministic collations. Due to an off-by-one error, the code failed to find matches at the end of the haystack. Fix by rewriting the loop. While at it, fix a comment that claimed that the function could find a zero-length match. Such a match could send a call