pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix multibyte issue in ltree_strncasecmp(). 6+ messages / 1 participants [nested] [flat]
* pgsql: Fix multibyte issue in ltree_strncasecmp(). @ 2025-12-16 18:49 Jeff Davis <jdavis@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Jeff Davis @ 2025-12-16 18:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/84d5efa7e3ebcf04694d312b0f14ceb35dcdfb8e Modified Files -------------- contrib/ltree/lquery_op.c | 40 ++++++++++++++++++++++++++++------------ contrib/ltree/ltree.h | 7 +++++-- contrib/ltree/ltxtquery_op.c | 8 ++++---- 3 files changed, 37 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix multibyte issue in ltree_strncasecmp(). @ 2025-12-16 18:49 Jeff Davis <jdavis@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Jeff Davis @ 2025-12-16 18:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f79e239e0bc6e4d5fe91e1a0e573ecf0715d6c8c Modified Files -------------- contrib/ltree/lquery_op.c | 40 ++++++++++++++++++++++++++++------------ contrib/ltree/ltree.h | 7 +++++-- contrib/ltree/ltxtquery_op.c | 8 ++++---- 3 files changed, 37 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix multibyte issue in ltree_strncasecmp(). @ 2025-12-16 18:49 Jeff Davis <jdavis@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Jeff Davis @ 2025-12-16 18:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b8cfe9dc2e7f052e727fc3bc07ccaef13ef55979 Modified Files -------------- contrib/ltree/lquery_op.c | 40 ++++++++++++++++++++++++++++------------ contrib/ltree/ltree.h | 7 +++++-- contrib/ltree/ltxtquery_op.c | 8 ++++---- 3 files changed, 37 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix multibyte issue in ltree_strncasecmp(). @ 2025-12-16 18:49 Jeff Davis <jdavis@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Jeff Davis @ 2025-12-16 18:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/b80227c0a54ccc6c358a24f2a8772667d0a4f0d4 Modified Files -------------- contrib/ltree/lquery_op.c | 40 ++++++++++++++++++++++++++++------------ contrib/ltree/ltree.h | 7 +++++-- contrib/ltree/ltxtquery_op.c | 8 ++++---- 3 files changed, 37 insertions(+), 18 deletions(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix multibyte issue in ltree_strncasecmp(). @ 2025-12-16 18:49 Jeff Davis <jdavis@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Jeff Davis @ 2025-12-16 18:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/335b2f30b468c133f86891ec3d82a2fd0d50e221 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(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
* pgsql: Fix multibyte issue in ltree_strncasecmp(). @ 2025-12-16 18:49 Jeff Davis <jdavis@postgresql.org> 0 siblings, 0 replies; 6+ messages in thread From: Jeff Davis @ 2025-12-16 18:49 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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(-) ^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2025-12-16 18:49 UTC | newest] Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-12-16 18:49 pgsql: Fix multibyte issue in ltree_strncasecmp(). Jeff Davis <jdavis@postgresql.org> 2025-12-16 18:49 pgsql: Fix multibyte issue in ltree_strncasecmp(). Jeff Davis <jdavis@postgresql.org> 2025-12-16 18:49 pgsql: Fix multibyte issue in ltree_strncasecmp(). Jeff Davis <jdavis@postgresql.org> 2025-12-16 18:49 pgsql: Fix multibyte issue in ltree_strncasecmp(). Jeff Davis <jdavis@postgresql.org> 2025-12-16 18:49 pgsql: Fix multibyte issue in ltree_strncasecmp(). Jeff Davis <jdavis@postgresql.org> 2025-12-16 18:49 pgsql: Fix multibyte issue in ltree_strncasecmp(). Jeff Davis <jdavis@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox