Re: BUG #15595: matchctx->npatterns is always 1 no matter pattern have 0 or 1 subexpression

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15595: matchctx->npatterns is always 1 no matter pattern have 0 or 1 subexpression
Дата
Msg-id 3697.1547692137@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #15595: matchctx->npatterns is always 1 no matter pattern have 0or 1 subexpression  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> when I use setup_regexp_matches, I found matchctx->npatterns is always 1 no
> matter pattern  have not or one subexpr subexpression.

It seems unlikely that this is a Postgres bug.

Just looking at the code in setup_regexp_matches, I wonder whether you
are passing use_subpatterns = true or not:

    /* do we want to remember subpatterns? */
    if (use_subpatterns && cpattern->re_nsub > 0)
    {
        matchctx->npatterns = cpattern->re_nsub;
        pmatch_len = cpattern->re_nsub + 1;
    }
    else
    {
        use_subpatterns = false;
        matchctx->npatterns = 1;
        pmatch_len = 1;
    }

            regards, tom lane


В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15596: Folders created with wrong permissions when installing anextension with a non-default umask
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #15595: matchctx->npatterns is always 1 no matter pattern have 0 or 1 subexpression