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.
Deep review at 12bc48e84be75f0f432010c7716e6d476faba753 against merge-base b6fa8ccfc729105a31f61dbed0c97d7f21a2b86e: no blocking finding; approve.
Read every changed hunk. The final delta correctly preserves the existing JSON_ARRAY_INSERT implementation: production is a comment-only +2/-4 change; tests/expected results are +172/-10; no design/framework/state-machine change or production performance impact. The earlier incorrect SQL-NULL shortcut is absent.
Independently checked the version-pinned MySQL 8.0.40 official regression: a nullable value inserts JSON null. Traced the existing SQL/binary prepared entry, shared value converter, path validation and bytejson array insertion. SQL NULL values remain distinct from NULL document/path and typed JSON null. Checked adjacent rows, later value pairs, invalid document/path, missing/scalar parents and NOT NULL UPDATE failure recovery; the new expectations exercise those real behaviors rather than a duplicate implementation.
Tests reuse the existing fixtures and cleanup, with only three SQL rows and one table; no new heavyweight setup. Prepared 51/52 controls cover non-NULL → NULL → non-NULL and protocol errors through actual parameter parsing and expression execution. Existing earlier assertions are retained. ARRAY_APPEND semantics are intentionally unchanged by this test-only scope.
Reused author’s function-package, focused prepared test and two 45/45 canonical BVT receipts; the author’s eight baseline frontend spool failures remain disclosed and are not relabeled as PASS. Fresh exact-head CI Required is SUCCESS (run 37905005874). No additional broad local rerun or live MySQL execution is claimed. No prior inline/review findings were present in GitHub metadata.
Merge Queue Status
This pull request spent 15 minutes 1 second in the queue, with no time running CI. ReasonPull request #29770 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. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #29764
The reported premise is corrected rather than implemented: a NULL value is inserted as JSON null. A NULL document or path returns SQL NULL. The issue remains open for QA and clarification.
What this PR does / why we need it:
Preserve the existing JSON_ARRAY_INSERT NULL-value behavior and add regression coverage. The previous PR head introduced an incorrect SQL-NULL shortcut that also bypassed document/path validation and changed missing/non-array-parent no-ops. This update removes that shortcut and uses the existing value converter and bytejson insertion path. Relative to the target base, production code changes only an explanatory comment.
The independent expected result comes from version-pinned MySQL 8.0.40 ARRAY_INSERT implementation, its SQL NULL to JSON null conversion, and the official NULL MTR case: a nullable value column produces
[[null, 1]], not SQL NULL. This contradicts the manual's blanket NULL wording. No live MySQL execution is claimed.Coverage includes literal/column NULL, a later NULL path-value pair, adjacent non-NULL rows, typed JSON null, missing/non-array parents, invalid documents/paths, SQL-NULL document/path controls, and a JSON NOT NULL column. The canonical BVT also verifies that a failed UPDATE preserves the document and that the next statement works. Prepared binary parameter rebinding covers non-NULL -> NULL -> non-NULL and MORPC 51/52 without introducing a new protocol path. ARRAY_APPEND behavior is unchanged and outside this issue's scope.
Validation on the repaired content:
TestJsonArrayInsert: PASS; completepkg/sql/plan/function: PASS.TestInitExecuteStmtParamDirectBinaryConstructor: PASS.make build: PASS.test/distributed/cases/function/func_json_array_insert.sql: two normal mo-tester runs, each 45/45 successful, no ignored cases; table teardown confirmed. Generated expectations were separately checked against the pinned oracle and SQL contract before comparison runs.git diff --check: PASS.pkg/frontend: FAIL in eight unrelated RETURNING spool tests due to allocation admission cap=1. The same eight failures reproduce with the original frontend test file; this is retained as a baseline validation limitation, not reported as PASS.Self-review covers the complete final diff and affected conversion, path validation, prepared rebinding, SQL write/error and teardown paths. The former semantic PASS based on the incorrect NULL oracle is superseded; no new independent Astra review is claimed.
Dependency: PR #29519, already merged as
d33bb6e8b926f150b78f97249ae73da7b2a98a4eand present in this branch; no outstanding merge-order dependency.QA required: yes. Automated SQL tests cover the user-visible result, NOT NULL write and failed-statement recovery. Live MySQL cross-engine comparison and deployment QA remain NOT_RUN; CI and maintainer review remain separate from local validation.