Re: Question on ThrowErrorData

2025-10-20 Thread Zhenghua Lyu
The comment seems not correct after the commit: commit dccda847b709e38ce6f09ac5c47f2bdf30e93a2c Author: Tom Lane Date: Thu Jun 27 14:43:59 2024 -0400 Avoid crashing when a JIT-inlined backend function throws an error. errfinish() assumes that the __FUNC__ and __FILE__ arguments it's

Re: Question on ThrowErrorData

2025-10-20 Thread Tom Lane
=?UTF-8?B?5q2j5Y2O5ZCV?= writes: > Inside errfinish, it just does a simple pointer assignment to set > filename and funcname field (via function set_stack_entry_location()). Please note the comment on struct ErrorData: * ErrorData holds the data accumulated during any one ereport() cy

Question on ThrowErrorData

2025-10-19 Thread 正华吕
Hi all, reading the source code of ThrowErrorData, it try to copy an ErrorData object into the correct memory context: newedata = &errordata[errordata_stack_depth]; recursion_depth++; oldcontext = MemoryContextSwitchTo(newedata->assoc_context); /* Copy the supplied fields