Skip to content

fix: preserve JSONLine text in OUTFILE round-trips - #30797

Merged
XuPeng-SH merged 8 commits into
matrixorigin:mainfrom
Lundomn:codex/issues-30704-30705-jsonline-roundtrip
Oct 22, 2026
Merged

XuPeng-SH merged 8 commits into
matrixorigin:mainfrom
Lundomn:codex/issues-30704-30705-jsonline-roundtrip

Conversation

@Lundomn

@Lundomn Lundomn commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Related to #30704
Related to #30705

What this PR does / why we need it

JSONLINE OUTFILE → LOAD could reinterpret the literal text \N as SQL NULL, and JSONLINE OUTFILE could silently replace invalid UTF-8 bytes with U+FFFD. The JSONLINE reader now distinguishes a JSON null token from a string value. OUTFILE rejects invalid UTF-8 for CHAR, VARCHAR, TEXT, and DATALINK before JSON serialization can silently alter the bytes.

A binary-origin DATALINK URL-path counterexample confirms the boundary: raw FF bytes remain stored, but the old JSON marshaler emitted EF BF BD and returned success. The corrected path returns an explicit JSONLINE invalid-UTF-8 error; a valid DATALINK URL still exports as its ordinary JSON string. No global DATALINK storage/cast validation, CSV behavior, binary wrapper semantics, or upstream #30741 pipe lifecycle is changed.

The regression coverage includes literal \N versus true NULL, object/array JSONLINE, CSV controls, invalid UTF-8 VARCHAR and DATALINK values, exact DATALINK storage bytes, no replacement-text export, and same-session recovery with a valid URL.

Validation

Exact published candidate: dd6ce76d6a3246fdd941d8d6fad2caf610b3da38.

  • Frontend focused DATALINK conversion test — PASS: ./.agents/skills/mo-dev/scripts/mo-cgo-test -run '^TestVectorValueToJSONRejectsInvalidUTF8Text$' -count=1 -v ./pkg/frontend.
  • Embedded public regression on final source — PASS: ./.agents/skills/mo-dev/scripts/mo-cgo-test -run '^TestJSONLineOutfileLoadPreservesTextAndRejectsInvalidUTF8$' -count=1 -v -timeout 180s ./pkg/embed. It verifies raw stored bytes, explicit malformed-row error, no U+FFFD output, a same-connection query after the error, and exact valid-URL JSON bytes.
  • Full frontend CGo package — PASS, 15.266s: ./.agents/skills/mo-dev/scripts/mo-cgo-test -p=1 -count=1 -timeout 300s ./pkg/frontend.
  • Full embed CGo package — PASS, 358.824s: ./.agents/skills/mo-dev/scripts/mo-cgo-test -p=1 -count=1 -timeout 10m ./pkg/embed. An earlier run with an explicit 5m total-package budget timed out as TestSQLFileAccessPeerPersistence had just started; no assertion failure was reported. The longer run passed. The final named embedded regression was rerun after the subsequent test-only Rows cleanup adjustment and passed.
  • Scoped Makefile static checks for ./pkg/frontend ./pkg/embed — PASS; molint/vet completed and pinned golangci-lint v2.14.0 reported 0 issues. gofmt and git diff --check — PASS.
  • The existing writable-stage BVT delta is unchanged from the independently reviewed b3a20 candidate; it passed normal comparison 124/124 twice with direct SQL/filesystem cleanup checks. Existing lifecycle focused/race-100 evidence also remains unchanged; this DATALINK delta adds no lifecycle mechanism.

The standalone service build and BVT service binary predate the DATALINK production guard and are not claimed as exact-dd6ce binary evidence. This narrow delta was validated with the current CGo package builds and the exact embedded regression. No benchmark was run, so there is no benchmark-based performance claim.

CI results

All currently applicable CI has completed for the actual published head dd6ce76d6a3246fdd941d8d6fad2caf610b3da38:

  • MatrixOne ALL CI — success. Required CI, shared build, UT x86, SCA arm64, UT coverage, Compose Proxy BVT, Standalone multi-CN pessimistic BVT, and coverage jobs passed.
  • Connector/J Pool Reset E2E — success.
  • Iceberg Connector E2E — workflow success; adapter module tidy passed. Iceberg E2E Local was skipped because the workflow currently sets if: false; this is not counted as a test pass.

Other MatrixOne ALL CI jobs skipped by workflow configuration are reported as skipped, not passed. The earlier ff321 CI failure is superseded and is not counted for this head.

Merge hold: DO NOT MERGE. This task authorizes publication and CI monitoring, not merging. Keep #30704 and #30705 open; the references above are intentionally non-closing.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added size/L Denotes a PR that changes [500,999] lines and removed size/M Denotes a PR that changes [100,499] lines labels Oct 22, 2026
@XuPeng-SH

XuPeng-SH commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-xupeng · superseded

Commit: dd6ce76d6a3246fdd941d8d6fad2caf610b3da38

"interrupted"

@XuPeng-SH

XuPeng-SH commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: dd6ce76d6a3246fdd941d8d6fad2caf610b3da38

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: dd6ce76d6a3246fdd941d8d6fad2caf610b3da38

Assessment: approve

Reviewed the complete 17-file delta and affected callers. The design restores JSON null/text separation in the shared reader, removes obsolete sentinel restrictions, and rejects invalid UTF-8 through the existing export conversion and cleanup owners. No actionable defects remain. The added UTF-8 scan is confined to JSONLine text export; ordinary SELECT/DML/DDL paths gain no new work.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Verified the frozen head, clean source, complete patch, changed-file hashes, formatting and whitespace checks.

  • Isolation preflight passed. Rejected incompatible retained libmo artifacts and successfully rebuilt current native sources through the repository Makefile.

  • All 30 selected test roots passed across frontend, external, externalwrite and embed. Coverage includes object/array null handling, explicit NULL mappings, binary wrappers, CSV controls, invalid UTF-8 rejection and allocation cleanup.

  • The real SQL integration test passed byte-exact round-trips, VARCHAR/DATALINK error propagation and subsequent successful exports on the same connection.

  • The conversion-error pipe lifecycle test passed race calibration and 100 repetitions under -race.

  • Reused frozen successful CI build, unit, static-analysis and multi-CN BVT check metadata. Local commands, source fingerprints, exit receipts and logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/825e670560706f64cd27ad3c/attempt-1/review-evidence.json.

Limitations:

  • Linked issue bodies were not included; their behavioral contracts were assessed from the frozen PR description and regression cases.

  • CI evidence contains check metadata, without per-case logs. No throughput benchmark was run; the additional text scan's cost was assessed structurally.

@mergify

mergify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

@mergify

mergify Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

queue

⚠️ Invalid commit message

Details

section not found

This branch was previously deployed

1 inactive deployment
ci — 7a196af2 Deployed Oct 22, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/wip kind/bug Something isn't working size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants