> On 13 November 2017 at 14:11, Arthur Zakirov <a.zaki...@postgrespro.ru> wrote: > > I have a little complain about how ExprEvalStep gets resvalue. resvalue is > > assigned in one place (within ExecEvalSubscriptingRefFetch(), > > ExecEvalSubscriptingRefAssign()), resnull is assigned in another place > > (within jsonb_subscript_fetch(), jsonb_subscript_assign()). > > Hm...I'm afraid I don't get this. `resnull` is never assigned inside > `jsonb_subscript_fetch` or `jsonb_subscript_assign`, instead it's coming > from `ExecInterpExp` as `isnull` if I remember correctly. Are we talking > about > the same thing? > > No, I meant ExprEvalStep struct. For example, within > ExecEvalSubscriptingRefFetch() you assign op->resvalue but op->resnull is > leaved as unchanged
Oh, I see now, thanks for the explanation. Actually, it's how it was implemented before in array subscripting, and I tried to be consistent with this implementation. But now I wonder if `resnull` is really needed in `jsonb_get_element`, `array_get_element` and it seems to me that I can even get rid of it so, that everything would be assigned in `jsonb_subscript_fetch`, `array_subscript_fetch` - I'll send a new version of the patch soon.