Repository navigation
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? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
[P1] Preserve the const-NULL guard before accessing the uint8 array payload
The new T_array_uint8 branch bypasses extractRowFromVector, which previously handled vec.IsConstNull() before reading the payload. The outer guard only checks vec.GetNulls().Contains(rowIdx), but a const-NULL vector has no payload and represents NULL through its constant class; its null bitmap does not make every nonzero logical row index safe.
I reproduced a deterministic panic on the current head with:
vec := vector.NewConstNull(types.T_array_uint8.ToType(), 3, mp)
row := make([]any, 1)
extractDataBranchSQLRowValue(context.Background(), nil, vec, 0, row, 2)This reaches vector.GetArrayAt[uint8], obtains an empty Varlena slice, and panics at bs[0] (index out of range). Before this PR, the generic extractor returned nil for the same valid vector shape.
Please make the top-level NULL check cover vec.IsConstNull() as well (preferably for the whole helper, which also protects the existing special-type branches), and add a regression using a const-NULL vector with length > 1 and a nonzero row index. The expected result is row[0] == nil and SQL literal NULL, with no payload access.
|
Addressed the const-NULL review finding in
Validation:
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-reviewed exact head e93797d after the const-NULL fix. No remaining code blockers.
Verified the focused regression on the PR head and on a simulated merge with current main; the full pkg/frontend test suite also passes on the merged tree. The returned uint8 slice is consumed synchronously before vector release, and the generic result-set representation remains unchanged.
The current BVT failures are unrelated to this change: this stale PR head lacks optools/run_bvt_group.sh referenced by the new main workflow. Please rebase current main and rerun CI before merge.
e93797d to
e423e2d
Compare
Merge Queue Status
This pull request spent 3 hours 27 minutes 36 seconds in the queue, with no time running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. 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#26136 ## What this PR does / why we need it: Data Branch SQL materialization previously received `VECUINT8` values as display strings, while its formatter requires the original `[]uint8` representation. Changes: - preserve `T_array_uint8` as `[]uint8` at the Data Branch-specific extraction boundary; - keep the generic result-set display-string contract unchanged; - cover non-empty, empty, and NULL values through extraction and exact SQL-literal formatting. Validation: - `go test ./pkg/frontend -run '^TestExtractDataBranchSQLRowValueUint8Array$' -count=3` - `go test ./pkg/frontend -count=1` - `git diff --check` Non-goals: - no change to generic SELECT/result-set representation; - no change to other vector or scalar formatter contracts. --------- 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#26136 ## What this PR does / why we need it: Data Branch SQL materialization previously received `VECUINT8` values as display strings, while its formatter requires the original `[]uint8` representation. Changes: - preserve `T_array_uint8` as `[]uint8` at the Data Branch-specific extraction boundary; - keep the generic result-set display-string contract unchanged; - cover non-empty, empty, and NULL values through extraction and exact SQL-literal formatting. Validation: - `go test ./pkg/frontend -run '^TestExtractDataBranchSQLRowValueUint8Array$' -count=3` - `go test ./pkg/frontend -count=1` - `git diff --check` Non-goals: - no change to generic SELECT/result-set representation; - no change to other vector or scalar formatter contracts. --------- 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#26136 ## What this PR does / why we need it: Data Branch SQL materialization previously received `VECUINT8` values as display strings, while its formatter requires the original `[]uint8` representation. Changes: - preserve `T_array_uint8` as `[]uint8` at the Data Branch-specific extraction boundary; - keep the generic result-set display-string contract unchanged; - cover non-empty, empty, and NULL values through extraction and exact SQL-literal formatting. Validation: - `go test ./pkg/frontend -run '^TestExtractDataBranchSQLRowValueUint8Array$' -count=3` - `go test ./pkg/frontend -count=1` - `git diff --check` Non-goals: - no change to generic SELECT/result-set representation; - no change to other vector or scalar formatter contracts. --------- 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 #26136
What this PR does / why we need it:
Data Branch SQL materialization previously received
VECUINT8values as display strings, while its formatter requires the original[]uint8representation.Changes:
T_array_uint8as[]uint8at the Data Branch-specific extraction boundary;Validation:
go test ./pkg/frontend -run '^TestExtractDataBranchSQLRowValueUint8Array$' -count=3go test ./pkg/frontend -count=1git diff --checkNon-goals: