Repository navigation
fix(function): preserve wide strings in SHA2 - #28104
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? |
76c7de6 to
bc93b6c
Compare
bc93b6c to
bfafed6
Compare
aptend
left a comment
There was a problem hiding this comment.
Deep review completed at exact head a4aae3c3178bc603df910c60cebdc79f60f4aa25 against current base/merge-base bf63172c0691e917ed2613c2d3a2d3d76a7f682e. I reviewed the complete four-file diff, SHA2 resolver and varlena execution path, all MySQL string domains, scalar implicit casts, NULL/invalid-algorithm behavior, binary-byte handling, and the distributed boundary regressions. The intervening merge of main preserves the reviewed patch byte-for-byte. Preserving the original CHAR/VARCHAR/TEXT/BINARY/VARBINARY/BLOB vector type is safe for GenerateFunctionStrParameter and removes the 65,535-byte VARCHAR cast boundary without changing the digest result type. No blocking issue found.
Validation on this exact head: git diff --check; full go test ./pkg/sql/plan/function -count=1; focused -race -run '^TestSHA2' -count=3; go vet ./pkg/sql/plan/function; and independent SHA-224/256/384/512 digest verification all passed with the required CGO/third-party setup.
…nto codex/issue-28103-sha2-longtext
|
Tick the box to add this pull request to the merge queue (same as
|
XuPeng-SH
left a comment
There was a problem hiding this comment.
Deep review on exact head c9f901f: no blocking findings.\n\nI reviewed the complete six-file diff as two independent closures.\n\nSHA2 correctness and performance: changing only the resolver from fixedTypeMatch to stringDomainFixedTypeMatch preserves CHAR, VARCHAR, TEXT, BINARY, VARBINARY, and BLOB vectors instead of casting them through the 65,535-byte VARCHAR boundary. SHA2Func already consumes all of those domains as varlena bytes. Scalar-to-string casts, NULL and invalid-algorithm behavior, digest result type, and all SHA-224/256/384/512 branches remain unchanged. Counterexamples for 65,535 versus 65,536 bytes, 160,000-byte LONGTEXT, explicit TEXT casts, embedded NUL bytes, and CHAR padding close correctly. The hot path removes the intermediate cast/copy; hashing remains one O(input bytes) pass with no new per-row allocation attributable to this change.\n\nBVT and delivery: the SQL case is self-contained and uses the minimum values needed to cross the truncation boundary. Exact-head CI proves function_sha2.sql actually executed with 22/22 statements passing in 0.191s. The downloader change raises only the default attempt budget from 4 to 6; HTTPS-only transport, SHA-256 verification, byte limits, temporary-file cleanup, atomic installation, and environment overrides are unchanged. Cache-hit and normal successful downloads still make zero and one curl calls respectively. Persistent failure latency rises from roughly 8 to 12 minutes for the single pinned ONNX artifact, but remains bounded. Exact-head downloader contract tests passed on Ubuntu and macOS, including default budget, failure atomicity, concurrency, checksum, and size-limit cases.\n\nThe Go behavior and focused package/race evidence from the prior reviewed commit remain semantically valid because later commits only normalize the BVT result and adjust the shell downloader. Exact-head UT, SCA, native checks, BVT, and git diff --check are green. Current main is six commits ahead but does not touch any affected file.
## Summary - preserve MySQL string domains when resolving SHA2, avoiding implicit truncation to the 65535-byte VARCHAR limit - add unit coverage for LONGTEXT, MEDIUMTEXT boundary input, binary BLOB bytes, and SHA-224/256/384/512 - add distributed SQL regression coverage for full-length and 65535-byte-prefix digest differences Fixes matrixorigin#28103 ## Validation - gofmt passed - git diff --check passed - expected digests independently verified with Python standard library - focused Go test could not build in the current environment because required CGo/native headers and cgo/libmo.dylib are unavailable - distributed BVT was not run because mo-tester and a running service are unavailable --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
## Summary - preserve MySQL string domains when resolving SHA2, avoiding implicit truncation to the 65535-byte VARCHAR limit - add unit coverage for LONGTEXT, MEDIUMTEXT boundary input, binary BLOB bytes, and SHA-224/256/384/512 - add distributed SQL regression coverage for full-length and 65535-byte-prefix digest differences Fixes matrixorigin#28103 ## Validation - gofmt passed - git diff --check passed - expected digests independently verified with Python standard library - focused Go test could not build in the current environment because required CGo/native headers and cgo/libmo.dylib are unavailable - distributed BVT was not run because mo-tester and a running service are unavailable --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
## Summary - preserve MySQL string domains when resolving SHA2, avoiding implicit truncation to the 65535-byte VARCHAR limit - add unit coverage for LONGTEXT, MEDIUMTEXT boundary input, binary BLOB bytes, and SHA-224/256/384/512 - add distributed SQL regression coverage for full-length and 65535-byte-prefix digest differences Fixes matrixorigin#28103 ## Validation - gofmt passed - git diff --check passed - expected digests independently verified with Python standard library - focused Go test could not build in the current environment because required CGo/native headers and cgo/libmo.dylib are unavailable - distributed BVT was not run because mo-tester and a running service are unavailable --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: XuPeng-SH <[email protected]>
Summary
Fixes #28103
Validation