Hello Fujii and Jim,
I can confirm reproduction aswell (planned to report it tomorrow but
Fujii beat me to it).
There's also another bug very close to this code: ANALYZE does not
enforce REJECT_LIMIT when on_error 'ignore' is enabled.
That's for a different unrelated commit, i'll report this soon, if it
interests you to take a look.
On 04/11/2026 16:26, Jim Jones wrote:
On 04/11/2026 14:37, Fujii Masao wrote:
Yeah, since AFAICT there seems no need to invoke registered callbacks,
ResetExprContext() might be sufficient. Also, ResetPerTupleExprContext()
would be better for consistency with CopyFrom(), which uses it?
IIUC es_per_tuple_exprcontext will always be non-NULL because of
GetPerTupleExprContext(), so in theory the extra check in
ResetPerTupleExprContext() is a bit redundant, but I agree it's a good
idea to keep the code consistent.
This also applies to:
- MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
+ MemoryContextSwitchTo(GetPerTupleMemoryContext(estate));
For the same exact reasons, it stays consistent with
fileIterateForeignScan(), if we want of course...
Regards,
Ayoub Kazar