Fix more multibyte issues in ltree

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: pgsql-hackers@postgresql.org
Date: 2026-02-13T21:56:42Z
Lists: pgsql-hackers

Attachments

Commit 84d5efa7e3 missed some multibyte issues caused by short-circuit
logic in the callers.

Repro:

   -- should return true, returns false
   SELECT 'sss'::ltree ~ 'ſſ*@'::lquery;

Patches attached; backport to 14 like 84d5efa7e3.

Regards,
	Jeff Davis

Commits

  1. Fix more multibyte issues in ltree.

  2. Fix multibyte issue in ltree_strncasecmp().