model-writtenrun 9234 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ivan Panchenko reported that a NULL argument following a string argument could fail conversion to jsonb because Perl reused a scalar with a different internal representation of undef, and supplied a targeted fix with plperl and plperlu regression tests in #1.
- Tom Lane questioned the type-specific fix and proposed using SvOK() to recognize undef, while raising concern about similar SvTYPE checks elsewhere, in #2.
- Ivan Panchenko revised the patch to use !SvOK() inside the switch's default branch, explaining that checking before the switch would mishandle hashes and arrays, and reported finding no similar cases in plperl.c in #3.
- Tom Lane committed #3 as e0f5048851, retaining its conversion logic and making light regression-test changes, with backpatching to PostgreSQL 11.
- In the final reply, Tom Lane confirmed the push, retained the switch because replacing it would enlarge the diff without much benefit, and noted that no other places explicitly checked SVt_NULL, closing the reported fix in #4.