MDEV-42371 LEAD() and LAG() read an offset of 2^63 or more as negative: LEAD(id, 18446744073709551614) returns the value two rows back #6228
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.29) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.29 · 72 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.257
Real PR Conversation Timeline
1 comments
"Review active on #6228"
general
weight: 0.35
gkodinov
MDEV-42371
Preserve the offset as a signed-or-unsigned integer and use the existing LEAD/LAG direction flag when computing the target row. Oversized unsigned offsets keep their direction, and LAG can handle the minimum signed offset without signed overflow. Targets outside the partition return
NULL.Rebased onto
10.11as requested in review. Local MariaDB 10.11.21 MTR passedmain.win_lead_lag,main.win_first_last_value, andmain.win_nth_value. The regression covers large unsigned offsets and the minimum signed offset.