Re: BUG #19406: substring(text) fails on valid UTF-8 toasted value in PostgreSQL 15.16
Noah Misch <noah@leadboat.com>
From: Noah Misch <noah@leadboat.com>
To: ranvis@gmail.com, pgsql-bugs@lists.postgresql.org
Cc: thomas.munro@gmail.com
Date: 2026-02-17T18:15:18Z
Lists: pgsql-bugs
Attachments
- ascii2utf8sql-v0.1.patch (text/plain) patch v0
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.
Commits
-
Suppress new "may be used uninitialized" warning.
- a0769e74d65d 14.22 landed
- ec86152e0209 15.17 landed
- 50d361f6223f 17.9 landed
- 2280ab354516 16.13 landed
- d04b34d685a2 18.3 landed
- 8cef93d8a588 19 (unreleased) landed
-
Fix SUBSTRING() for toasted multibyte characters.
- a20eb248c51a 15.17 landed
- 14b1fd6176cb 14.22 landed
- bdfb372280bc 16.13 landed
- 5d5232bc38d3 17.9 landed
- 6e045e1a6e3f 18.3 landed
- 9f4fd119b2cb 19 (unreleased) landed
-
pg_mblen_range, pg_mblen_with_len: Valgrind after encoding ereport.
- 44fc85bbf990 14.22 landed
- 8e73530f1546 17.9 landed
- 5b305ebcc9b5 15.17 landed
- 45eb47230d93 16.13 landed
- 4174e41b9e9e 18.3 landed
- 4644f8b23bb8 19 (unreleased) landed