Re: BUG #18947: TRAP: failed Assert("len_to_wrt >= 0") in pg_stat_statements

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, a(dot)kozhemyakin(at)postgrespro(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18947: TRAP: failed Assert("len_to_wrt >= 0") in pg_stat_statements
Date: 2025-06-10 22:39:51
Message-ID: aEi0N9AmJnrFC6Ug@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jun 10, 2025 at 08:14:40PM +0900, Michael Paquier wrote:
> Hmm. I am wondering whether this would be enough; these are not the
> only places where we use select_no_parens and select_with_parens. I'd
> be curious to see what you think a fully-bloomed fix should look like.

By the way, this report also means that none of the problematic query
patterns are run in the main regression test suite, or we would have
noticed something immediately when running the recovery test
027_stream_regress.pl that loads PGSS.

So we have a problem in test coverage with query normalization
patterns. But we also have a second, older, problem in terms of
coverage regarding the parentheses patterns that are assumed as
supported in the parser. Even if we finish by reverting the nested
query tracking support for now (let's settle things before beta2 not
after it), we should definitely improve the main regression test suite
in this area to make sure that reintroducing it safe.
--
Michael

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fujii Masao 2025-06-10 22:57:19 Re: BUG #18947: TRAP: failed Assert("len_to_wrt >= 0") in pg_stat_statements
Previous Message Masahiko Sawada 2025-06-10 19:19:55 Re: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5