Hi
Inline handler creates simple_eval_resowner (without parent).
Inside plpgsql_estate_setup this value is assigned to estate->simple_eval_resowner
<-->if (simple_eval_resowner)
<--><-->estate->simple_eval_resowner = simple_eval_resowner;
<-->else
<--><-->estate->simple_eval_resowner = shared_simple_eval_resowner;
When we call procedure with inner COMMIT, then when "before_lxid != after_lxid" following code is
executed.
<--><-->estate->simple_eval_estate = NULL;
<--><-->estate->simple_eval_resowner = NULL;
<--><-->plpgsql_create_econtext(estate);
and
fragment from plpgsql_create_econtext
<-->/*
<--> * Likewise for the simple-expression resource owner.
<--> */
<-->if (estate->simple_eval_resowner == NULL)
<-->{
<--><-->if (shared_simple_eval_resowner == NULL)
<--><--><-->shared_simple_eval_resowner =
<--><--><--><-->ResourceOwnerCreate(TopTransactionResourceOwner,
<--><--><--><--><--><--><--><--><-->"PL/pgSQL simple expressions");
<--><-->estate->simple_eval_resowner = shared_simple_eval_resowner;
<-->}
In this case simple_eval_resowner from inline handler is overwritten and only shared_simple_eval_resowner will be used.
So is it "estate->simple_eval_resowner = NULL;" error (without other conditions)?