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
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");
 

Reply via email to