model-writtenrun 6157 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Dean Rasheed opened the thread with a fix for negative numeric bases raised to integer powers outside int32, moving sign handling and exponent validation into the general power_var() path #1.
- Further testing found that numbers just below one could incorrectly produce one or an overflow error when raised to very large powers; Dean proposed returning zero for underflow and combined these related fixes with the original patch #2 #3.
- Zhihong Yu suggested changing the overflow error wording, but Dean retained the established wording used throughout the numeric functions #4 #5.
- Yugo Nagata tested the combined patch and questioned moving the SQL-standard error check; Dean explained that the move avoids redundant checks and added comments documenting the required SQLSTATE, which Yugo accepted #6 #7 #8.
- Dean then revised the precision calculation to use an explicit nonnegative significant-digit count, while deferring a newly discovered problem in the initial logarithm estimate for bases extremely close to one #10.
- The combined negative-base, precision, and underflow fixes landed from #10 as 4dd5ce2fd9, with only an equivalent assignment split and commit-message edits.
- Tom Lane reported a buildfarm failure after that landing and investigated a compiler dependency; Dean traced it to broken reverse-conversion overflow checks and submitted explicit integer-bound comparisons plus conversion tests #11 #13 #14.
- Tom found the fix plausible and recommended pushing before the upcoming releases; 2642df9fac landed from #14, additionally improving the underflow tests to display unexpected values #15 #17.
- Dean kept the work open for the deferred precision issue and later submitted a separate fix removing the initial logarithm estimate's scale cap, explaining that it still computes only about eight significant digits and remains fast #20 #22.
- Alvaro Herrera requested a clearer explanation of the missing scale cap and reported difficulty verifying the test with bc; Dean expanded the comment and supplied a verification expression using logarithms and exponentials #23 #24.
- At the thread's last exchange, the final precision fix was awaiting commitment: Dean planned to commit and backpatch it for maintenance consistency, and Jaime Casanova moved the entry to the next Commitfest #26 #27.
- After the last thread message, the remaining fix landed unchanged from #24 as e54a758d24, completing all three fixes.