model-writtenrun 3556 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Tender Wang reported a SQLancer-discovered Memoize failure caused by expression-context resets corrupting pass-by-reference probe values, and proposed copying those values in #1.
- Andrei Lepikhov reproduced missing cache hits and tested the initial fix in #3, then supplied explicit tableContext allocation and a numeric-expression regression test in #4; he subsequently warned that those copies could accumulate until the hash table was reset in #6.
- Richard Guo traced the problem to resetting the expression context between hashing and equality comparison and tested removing the hash-function reset in #7; Andrei raised the possibility of memory accumulation when hash values were unique in #8.
- Tender added NULL handling while retaining tableContext allocation in #9, but Andrei favored Richard's approach because of its memory behavior in #10.
- Tender abandoned probe-value copying in #11, moving expression-context reset to the start of ExecMemoize() and removing resets from hashing and equality checks; after finding no memory leak and confirming another corruption symptom, he restored Andrei's regression test in #12.
- Andrei accepted the revised patch in #13 and urged prompt fixing and backpatching instead of waiting for a later commitfest in #15.
- David Rowley committed #12 as e629846472, preserving the executor fix while making cosmetic edits and strengthening the test to check predictable cache hits and misses before work_mem was reduced, as explained in #18; the fix was backpatched through PostgreSQL 14.
- The thread ended with Tender acknowledging the committed fix in #19, with no further patch revisions or unresolved work recorded.