pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Japin Li <japinli@hotmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17983: Assert IsTransactionState() failed when empty string statement prepared in aborted transaction
Date: Wed, 21 Jun 2023 09:45:23 +0800
Message-ID: <MEYP282MB16694FA5DA0442708310344DB65DA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <3505791.1687278747@sss.pgh.pa.us>
References: <17983-da4569fcb878672e@postgresql.org>
	<MEYP282MB16691E0295CE3501C8EABD89B65CA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
	<3505791.1687278747@sss.pgh.pa.us>


On Wed, 21 Jun 2023 at 00:32, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Japin Li <japinli@hotmail.com> writes:
>> Yeah, SearchSysCache1() need in an transaction block, here is a patch
>> fixed it.
>
> I'm not sure if anyone out there is expecting that this case should
> work, but it probably did work at one time.  Rather than throwing
> an error, it'd be better to fix plancache.c so it doesn't fail.
> I looked at the code and found that that's pretty much a one-line
> fix, because there are already code paths that avoid doing anything
> extra for transaction control commands (e.g ROLLBACK, which'd
> otherwise have this same issue).

Agreed, it's much better than throwing an error. LGTM.

>> Another question, why should we need to create a plan cache entry for
>> empty input?
>
> Well, we have to have something to support the wire protocol behavior
> for this case.  No doubt we could hack up postgres.c to handle it
> without a plan cache entry, but it'd be far more invasive to do it
> there.
>

Thanks for your explanation! Got it.

-- 
Regrads,
Japin Li.





view thread (4+ messages)

Message-ID: <MEYP282MB16694FA5DA0442708310344DB65DA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>
Permalink:  ../MEYP282MB16694FA5DA0442708310344DB65DA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/MEYP282MB16694FA5DA0442708310344DB65DA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: japinli@hotmail.com, tgl@sss.pgh.pa.us, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17983: Assert IsTransactionState() failed when empty string statement prepared in aborted transaction
  In-Reply-To: <MEYP282MB16694FA5DA0442708310344DB65DA@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox