Repository navigation
fix(window): handle signed integer range bounds - #27578
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
aunjgr
left a comment
There was a problem hiding this comment.
Reviewed exact head 7d7d83980729e03e969f7b8c227544493ff3933c against merge base ae12701a888fac102e9641cc7cbb8706527366d8.
The helper detects both overflow directions for addition and subtraction without assuming a particular signed width, and its aboveDomain result maps to the correct insertion edge for ASC and DESC. I checked the complete frame mapping: ASC PRECEDING subtracts, ASC FOLLOWING adds, DESC PRECEDING adds, and DESC FOLLOWING subtracts, including zero offsets and MinInt negative-offset arithmetic. Search-left/search-right preserve their inclusive/exclusive contracts after an out-of-domain result. The tests cover every signed width, extrema, both sort directions, empty frames, and NULL peers with public SQL result oracles. No operator lifecycle, ownership, or wait path changes. I found no blocking issue.
XuPeng-SH
left a comment
There was a problem hiding this comment.
Approved exact head 7d7d83980729e03e969f7b8c227544493ff3933c against merge base ae12701a888fac102e9641cc7cbb8706527366d8.
The new signedRangeBound detects addition and subtraction overflow for every signed width, including MinInt offsets, and outOfDomainRangeBoundary maps above/below-domain keys to the correct insertion edge for ASC and DESC. I checked the complete frame-direction mapping: ASC PRECEDING subtracts, ASC FOLLOWING adds, DESC PRECEDING adds, and DESC FOLLOWING subtracts; left remains inclusive and right remains exclusive.
I also ran an independent big.Int oracle over int8/int16/int32/int64, ASC/DESC, left/right searches, both arithmetic directions, five offsets, extrema, interior values, and duplicate peers. It passed normal and race runs 20 times each. The full window package passed normal and race tests; go vet, git diff --check, and formatting checks passed. The hot-path cost is constant comparisons only, with no allocation, logging, ownership, or lifecycle change. I found no blocking issue.
Merge Queue Status
This pull request spent 32 minutes 28 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. Requeued — the merge queue status continues in this comment ↓. |
aptend
left a comment
There was a problem hiding this comment.
Reviewed the full signed RANGE boundary change at the exact head. Verified the ASC/DESC and PRECEDING/FOLLOWING direction matrix, insertion-edge mapping, NULL/empty-frame behavior, and exhaustive int8 arithmetic against a wider integer oracle; all focused, race, vet, and diff checks passed. No blocking issues found.
7d7d839 to
f9280f8
Compare
Merge Queue Status
This pull request spent 13 minutes 32 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonPull request #27578 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Tick the box to put this pull request back in the merge queue (same as
|
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#27574 ## What this PR does / why we need it: Prevent signed integer RANGE frame boundary arithmetic from wrapping at the minimum and maximum values of TINYINT, SMALLINT, INT, and BIGINT. Out-of-domain search keys are now mapped to the correct insertion boundary for both ascending and descending order. Add unit coverage for overflow, underflow, PRECEDING/FOLLOWING, and ASC/DESC behavior, plus a BVT covering all signed integer types, empty frames, and NULL peer groups. Local validation: - Window package unit tests - Window package race tests - Window package go vet - Package coverage: 84.2%; changed statements: 52/52 (100%) - BVT expected-result comparison repeated 3 times - 500,010-row boundary validation repeated 2 times Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#27574 ## What this PR does / why we need it: Prevent signed integer RANGE frame boundary arithmetic from wrapping at the minimum and maximum values of TINYINT, SMALLINT, INT, and BIGINT. Out-of-domain search keys are now mapped to the correct insertion boundary for both ascending and descending order. Add unit coverage for overflow, underflow, PRECEDING/FOLLOWING, and ASC/DESC behavior, plus a BVT covering all signed integer types, empty frames, and NULL peer groups. Local validation: - Window package unit tests - Window package race tests - Window package go vet - Package coverage: 84.2%; changed statements: 52/52 (100%) - BVT expected-result comparison repeated 3 times - 500,010-row boundary validation repeated 2 times Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: Fixes matrixorigin#27574 ## What this PR does / why we need it: Prevent signed integer RANGE frame boundary arithmetic from wrapping at the minimum and maximum values of TINYINT, SMALLINT, INT, and BIGINT. Out-of-domain search keys are now mapped to the correct insertion boundary for both ascending and descending order. Add unit coverage for overflow, underflow, PRECEDING/FOLLOWING, and ASC/DESC behavior, plus a BVT covering all signed integer types, empty frames, and NULL peer groups. Local validation: - Window package unit tests - Window package race tests - Window package go vet - Package coverage: 84.2%; changed statements: 52/52 (100%) - BVT expected-result comparison repeated 3 times - 500,010-row boundary validation repeated 2 times Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #27574
What this PR does / why we need it:
Prevent signed integer RANGE frame boundary arithmetic from wrapping at the minimum and maximum values of TINYINT, SMALLINT, INT, and BIGINT. Out-of-domain search keys are now mapped to the correct insertion boundary for both ascending and descending order.
Add unit coverage for overflow, underflow, PRECEDING/FOLLOWING, and ASC/DESC behavior, plus a BVT covering all signed integer types, empty frames, and NULL peer groups.
Local validation: