Repository navigation
fix: encode BIT dump values as hexadecimal SQL literals - #54
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
APPROVE at a17e7bc (base 324c33d).
Read the complete production and test delta and traced convertValue -> showInsert -> restore. The existing value encoder remains the owner; hexadecimal literals remove the quoting ambiguity without adding a second encoding path. NULL, leading zeros, empty-byte handling, mixed-case type names and all 256 one-byte values have independent output/decode oracles. No compatibility path or unnecessary abstraction was added.
Independent validation: owning-package tests have 29 passing test/subtest events, with only the two unchanged, independently base-confirmed CSV assertion failures; standalone build, vet, gofmt and diff checks pass. Real CLI export/restore preserved BIT(8)/BIT(64), quote/backslash bytes, NULL and the 64-bit maximum exactly. No unresolved actionable review comments found. No subagents used.
This approval is scoped to the reviewed change; it does not claim a green baseline package, latest-main server validation, or final combined-PR validation.
Summary
Fixes matrixorigin/matrixone#30557.
Related to #50 (closed after migration to the MatrixOne issue tracker).
Encode non-NULL BIT values as hexadecimal SQL literals instead of partially escaped
_binary '...'strings. Previously, a quote byte (0x27) produced invalid SQL and a backslash byte (0x5C) could change the literal's interpretation, despite a successful export.0xliteral.Regression coverage
Validation
On macOS arm64, using Go 1.23.0 as declared by this repository's
go.mod, with the worktree's own CGo artifacts:go test -mod=readonly -v -count=1 -timeout=120s -run '^(TestConvertValueBit|TestShowInsertBit)$' ./cmd/mo-dump8d78f7e):go test -mod=readonly -v -count=1 -timeout=120s -coverprofile=coverage.out ./cmd/mo-dump(complete owning package, including CSV tests).go vet -mod=readonly ./cmd/mo-dumpmake buildgit diff --check, and incremental golangci-lint v1.61.0 (built with Go 1.23.0).--binary-mode=1. All 11 rows, primary keys, NULLs, andHEX()results matched for BIT(1), BIT(8), BIT(16), and BIT(64), including quote/backslash/control bytes and the 64-bit maximum. The test database and test-owned service were cleaned up.Known validation limitations
The previous CSV baseline failures were resolved upstream by #63. Main has been merged without reverting those fixes; the complete package now passes. The BIT implementation and SQL restore path are unchanged by the merge, so the real-client round-trip evidence above remains applicable.
The real-service compatibility check used an existing MatrixOne binary built from clean revision
9dfe5c1be92e6ecc2cd32d1ee2deeb54233381c3; it is not a rebuild or validation of the latest MatrixOne main revision.