model-writtenrun 7429 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ranier Vilela reported that inline_function could pass an uninitialized rettupdesc to check_sql_fn_retval in #1; when Mark Dilger requested a patch in #2, Ranier explained that he did not know the correct initialization in #3.
- Zhihong Yu suggested obtaining rettupdesc through get_expr_result_type in #4, and Ranier pointed out that this also required correctly constructing fexpr in #5.
- Tom Lane traced the problem to SQL-function-body handling and reproduced the otherwise difficult-to-reach failure by disabling check_function_bodies in #6; he proposed constructing the inexpensive dummy FuncExpr and resolving the result descriptor for both paths.
- Tom implemented that proposal in e30e3fdea8, moving FuncExpr construction before body processing and resolving rettupdesc after the query eligibility checks.
- After the commit, Ranier submitted an independently prepared patch following Tom's guidance in #7, also removing redundant variables and narrowing declaration scopes, and reported that vcregress check passed; these additional cleanups were absent from the committed fix.
- Tom explained that he had already pushed the fix in #8, and Ranier acknowledged the resolution in #9, closing the thread with the bug fixed and no further work requested.