pgsql: Repair bug in regexp split performance improvements.

From: Andrew Gierth <rhodiumtoad(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Repair bug in regexp split performance improvements.
Date: 2018-09-12 18:56:02
Message-ID: E1g0AJ0-0001AY-4Y@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Repair bug in regexp split performance improvements.

Commit c8ea87e4b introduced a temporary conversion buffer for
substrings extracted during regexp splits. Unfortunately the code that
sized it was failing to ignore the effects of ignored degenerate
regexp matches, so for regexp_split_* calls it could under-size the
buffer in such cases.

Fix, and add some regression test cases (though those will only catch
the bug if run in a multibyte encoding).

Backpatch to 9.3 as the faulty code was.

Thanks to the PostGIS project, Regina Obe and Paul Ramsey for the
report (via IRC) and assistance in analysis. Patch by me.

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/03e0bc1171c864b9add64f0ef5351126faa4e3f5

Modified Files
--------------
src/backend/utils/adt/regexp.c | 16 ++++++++++------
src/test/regress/expected/strings.out | 18 ++++++++++++++++++
src/test/regress/sql/strings.sql | 3 +++
3 files changed, 31 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2018-09-12 19:25:36 pgsql: Minor fixes for psql tab completion.
Previous Message Andrew Dunstan 2018-09-12 16:26:29 pgsql: On all Windows platforms, not just Cygwin, use _timezone and _tz