pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Koval <d.koval@postgrespro.ru>
To: pgsql-hackers@postgresql.org
Subject: Assignment before assert
Date: Thu, 13 Feb 2025 20:08:26 +0300
Message-ID: <1618848d-cdc7-414b-9c03-08cf4bef4408@postgrespro.ru> (raw)

Hi!
Function EvalPlanQualFetchRowMark contains an assignment

	ExecRowMark *erm = earm->rowmark;

before assert

	Assert(earm != NULL);

Maybe these lines need to be swapped?

-- 
With best regards,
Dmitry Koval

Postgres Professional: http://postgrespro.com

Attachments:

v1-0001-fix-assignment-before-assert.patch (text/plain, 661B) download diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index 39d80ccfbad..963aa390620 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -2662,13 +2662,15 @@ bool EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot) { ExecAuxRowMark *earm = epqstate->relsubs_rowmark[rti - 1]; - ExecRowMark *erm = earm->rowmark; + ExecRowMark *erm; Datum datum; bool isNull; Assert(earm != NULL); Assert(epqstate->origslot != NULL); + erm = earm->rowmark; + if (RowMarkRequiresRowShareLock(erm->markType)) elog(ERROR, "EvalPlanQual doesn't support locking rowmarks");

view thread (4+ messages)  latest in thread

Message-ID: <1618848d-cdc7-414b-9c03-08cf4bef4408@postgrespro.ru>
Permalink:  ../1618848d-cdc7-414b-9c03-08cf4bef4408@postgrespro.ru/
Also on:    postgresql.org/message-id/1618848d-cdc7-414b-9c03-08cf4bef4408@postgrespro.ru

 ·  · 

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-hackers@postgresql.org
  Cc: d.koval@postgrespro.ru
  Subject: Re: Assignment before assert
  In-Reply-To: <1618848d-cdc7-414b-9c03-08cf4bef4408@postgrespro.ru>

* 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