MDEV-40254 Preserve large ROUND results in internal temporary tables #5775
All Vouch review confidence checks passed
Residual risk 0.03 = Change Risk (0.28) × (1 − Review Confidence (0.90)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.28 · 30 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.91 · 2 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.205
Real PR Conversation Timeline
5 items
Do you need all of these SET statements? Ditto the CREATE DATABASE? Please always strive towards the minimal and the simplest test case.
Do you really need all of these test cases? does any of them provide extra coverage? Please remove the ones that do not.
Changes Requested
Thank you for your contribution! This is a preliminary review.
The test case obviously needs simplification. Please attend to that.
Approved
LGTM. Thanks!
Please stand by for the final review.
gkodinov
DerZc
ROUND() has already applied the requested scale to its DOUBLE result. Its internal temporary field nevertheless treats the display width and scale as storage limits, so materialization can clip large rounded values and change grouped query results.
Mark the internal DOUBLE field's scale as unfixed after ROUND() has computed its result, allowing the full floating-point range to be stored.
Regression coverage
Add one grouped query to
main.func_mathover squared BIGINT values. Two rows are necessary to exercise temporary-table storage; a one-row probe already passes on the unmodified server. It checks that the exact value 100000000000000000000 and its row count survive temporary-table storage. The five-line regression needs no self-join, extra SET, database creation, engine setting, manual prepared statements or duplicate queries.Validation
On current
11.4atf49e838d367f2154b3edb43effa99ff9eb0d8602:main.func_mathonly on the new query, returning 100000000000000000 instead of 100000000000000000000.main.func_math,main.func_group,main.group_by,main.select,main.type_decimal,main.type_floatandmain.viewpass.main.func_mathpasses.main.func_mathpasses.Bug report: https://jira.mariadb.org/browse/MDEV-40254