MDEV-40089 Preserve unsigned cached integers in real comparisons #5769
All Vouch review confidence checks passed
Residual risk 0.02 = Change Risk (0.23) × (1 − Review Confidence (0.90)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.23 · 15 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.91 · 3 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.166
Real PR Conversation Timeline
6 items
this might have side effects on the pre-existing tests. if you need something like that add a new test file.
no redundant SET or CREATE DATABASE statements please.
avoid anything that is not essential to the regression test at hand.
remove all the redundant queries that do not contribute to code coverage please. in this particular case mtr runs tests with view and prepared statements protocols.
Changes Requested
Thank you for your contribution! This is a preliminary review.
One general note on the commit message: please do not summarize the changes done.
Good commit messages usually follow the following pattern:
1. what was wrong exactly
2. how it was fixed
3. how was the fix tested.
Approved
LGTM. Thanks! Please stand by for the final review.
gkodinov
DerZc
Item_cache_int::val_real() interprets stored unsigned bits as a signed integer before converting to DOUBLE. Values above LLONG_MAX become negative, so a BETWEEN predicate using a cached ~TRUE bound can wrongly discard rows.
Use unsigned_flag to convert unsigned cached values through ulonglong before converting to DOUBLE.
Regression coverage
Add one query to
main.func_bitwith a bitwise complement and a VARCHAR column. Two rows prevent constant-table optimization from bypassing the cache. Both should satisfy IS FALSE because zero is below the unsigned lower bound; ORDER BY makes the result deterministic.The five-line test needs no InnoDB prerequisite, SET, database creation, manual prepared statements or duplicate queries. Existing test prerequisites remain unchanged, and MTR supplies prepared-statement and view protocol coverage.
Validation
On current
11.4atf49e838d367f2154b3edb43effa99ff9eb0d8602:main.func_bitonly on the new query, returning no rows instead of0and1.main.func_bit,main.select,main.type_bit,main.type_bit_innodb,main.type_decimalandmain.type_floatpass.main.func_bitpasses.main.func_bitpasses.Bug report: https://jira.mariadb.org/browse/MDEV-40089