Re: BUG #19406: substring(text) fails on valid UTF-8 toasted value in PostgreSQL 15.16

From: Noah Misch <noah(at)leadboat(dot)com>
To: ranvis(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: thomas(dot)munro(at)gmail(dot)com
Subject: Re: BUG #19406: substring(text) fails on valid UTF-8 toasted value in PostgreSQL 15.16
Date: 2026-02-17 18:15:18
Message-ID: 20260217181518.c4.noahmisch@microsoft.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Feb 13, 2026 at 04:21:13PM -0800, Noah Misch wrote:
> On Fri, Feb 13, 2026 at 02:48:04PM -0800, Noah Misch wrote:
> > Attached. I may add some more tests, e.g. a toasted invalid string where the
> > detoasted length is less than the slice we request.
>
> Tests already covered that in particular, but I added some other tests.

I cast a wider net for string function bugs specific to toasted strings and/or
multibyte text. That yielded the attached. This did reproduce $SUBJECT, but
it didn't find additional bugs. The method is crude, but I'm archiving it
here so folks know the testing happened and in case someone pursues similar
testing in the future.

Attachment Content-Type Size
ascii2utf8sql-v0.1.patch text/plain 16.8 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2026-02-17 18:47:49 Re: BUG #19411: libpq 16.x exhibits a memory leak when connections are repeatedly created and destroyed
Previous Message Matt Carter 2026-02-17 17:54:17 RE: BUG #19411: libpq 16.x exhibits a memory leak when connections are repeatedly created and destroyed