pgsql: Fix multibyte issue in ltree_strncasecmp().

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема pgsql: Fix multibyte issue in ltree_strncasecmp().
Дата
Msg-id E1vVa7E-0016yA-2G@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix multibyte issue in ltree_strncasecmp().

Previously, the API for ltree_strncasecmp() took two inputs but only
one length (that of the smaller input). It truncated the larger input
to that length, but that could break a multibyte sequence.

Change the API to be a check for prefix equality (possibly
case-insensitive) instead, which is all that's needed by the
callers. Also, provide the lengths of both inputs.

Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/5f65b85740197ba6249ea507cddf609f84a6188b.camel%40j-davis.com
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/898991966bc9e9a54ac11a7129c3b0659a9c2f8d

Modified Files
--------------
contrib/ltree/lquery_op.c    | 40 ++++++++++++++++++++++++++++------------
contrib/ltree/ltree.h        |  9 ++++++---
contrib/ltree/ltxtquery_op.c |  8 ++++----
3 files changed, 38 insertions(+), 19 deletions(-)


В списке pgsql-committers по дате отправления: