model-writtenrun 5532 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Andrei Lepikhov reported that rounding LONG_MAX to double could make group-count conversions return negative values during SQLancer testing, and raised the alternative of keeping plan-node group counts as doubles until use #1.
- Andrei Lepikhov submitted an in-place fix for four conversions, using a strict comparison before casting and adding an aggregation regression test #2.
- Tom Lane objected to duplicating a delicate, undocumented conversion pattern and proposed a shared conversion function beside clamp_row_est() #3.
- Andrei Lepikhov adopted that proposal with clamp_cardinality_to_long(), using the Cardinality type and handling negative and NaN inputs while preserving the original regression test #4.
- Tom Lane committed the revised patch with light cleanup as a916cb9d5a, restricting the fix to the development branch because the extreme estimates were mainly a fuzz-testing concern; his closing message confirmed the landing and explained that the regression test was omitted because it failed to demonstrate the bug on his system and was too expensive #5.