Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"

From: Aleksander Alekseev <aleksander(at)timescale(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: dhyan(at)nataraj(dot)su
Subject: Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"
Date: 2024-11-14 15:08:52
Message-ID: CAJ7c6TMTtatgBOJJz4TkfuAQoEOm3pPg-iGHgHM0jXvWZH74UQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

> I wonder if the Assert is just wrong or if it's more complicated than that.
>
> For the record:
>
> ([^\d\D]){0} - OK
> (?:[^\d\D]){1} - OK
> (?:[^\D]){0} - OK
> (?:[^\d]){0} - OK
> '(?:[^\d\D]){0}' - FAIL

Well, removing the assert helps, and the regex seems to work correctly
after that.

This however is almost certainly not a correct fix (the assert is
right about lp->nouts == 0 it's only unhappy about rp->nins != 0) and
a second opinion is certainly needed since I'm looking at
src/backend/regex/regc_nfa.c for the first time in my life :)

--
Best regards,
Aleksander Alekseev

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Greg Sabino Mullane 2024-11-14 15:11:25 Re: Export PostgreSQL database into mysql database
Previous Message Aleksander Alekseev 2024-11-14 14:50:23 Re: BUG #18708: regex problem: (?:[^\d\D]){0} asserts with "lp->nouts == 0 && rp->nins == 0"