model-writtenrun 888 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Shruthi Gowda reported crashes when ECPGdeallocate_all() and ECPGprepared_statement() ran without a valid connection and proposed explicit NULL checks in #1; Tom Lane requested auditing the other connection lookups in #2.
- Shruthi added ECPGget_desc() validation in #3, then adopted Fujii Masao's proposal to reuse ecpg_init() from #4 in the revision #5.
- Mahendra Singh Thalor requested regression tests in #6, while Nishant Sharma recommended keeping descriptor validation local and identified another unchecked connection in ecpg_freeStmtCacheEntry() in #7.
- Shruthi implemented those changes and supplied tests in #8, but reported that she could not trigger the statement-cache cleanup path, leaving that path without a dedicated regression case.
- Nishant found test-integration problems and an early return that bypassed locale cleanup in #9; Shruthi moved validation before locale setup and explained why stale cache slots must still be reclaimed in #11.
- Further review in #12 and #14 led to branch-specific test patches, corrected test data and output, and ROLLBACK before DISCONNECT in #13 and #15; Nishant reported successful regression testing across supported branches and approved the final patches in #16.
- Andrew Dunstan combined the implementation and tests from #15 into c34a280c85, adding an explanatory cache-cleanup comment and backpatching through PostgreSQL 14, then announced the push in #17.
- After landing, Alexander Lakhin reported continuing threaded ECPG crashes and reproduced similar failures with max_connections set to 10 in #18; Tom Lane confirmed crashes or hangs on older code and cautioned that the buildfarm failures might have a different cause in #19.
- Andrew proposed a separate fix in #21 that records connection ownership and restores defaults after failed connections, preventing a thread from implicitly using another thread's connection; he credited Claude with the patch and noted that applications relying on implicit sharing would need explicit connection selection.
- Tom favored the safer behavior change, requested documentation changes, and suggested moving thread initialization into the new helper in #22; Andrew and Tom agreed to defer action until after the imminent releases in #23 and #24.
- SATYANARAYANA NARLAPURAM proposed another NULL check in ecpg_auto_prepare() in #25, but Shruthi explained that its caller already validates the connection in #26.
- Michael Paquier instead proposed passing the already-resolved connection to avoid a duplicate lookup and requested a regression test if extra validation was necessary in #27; Shruthi agreed with passing the connection but explained why the connection name and some lookups remained necessary in #28.
- At the end of the supplied thread, the original validation fix had landed, while the thread-ownership patch from #21 had no recorded landing and the additional validation proposal from #25 remained unresolved following the discussion in #28.