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 re-review of exact head eaf150e, merge-base bab4b32: APPROVE. No remaining blocking finding in this scoped increment.
Both previous review findings are closed in code, not merely marked resolved: ARRAY_INSERT now requests strict scalar AND object parent lookup from the existing resolver, while every pre-existing caller preserves its old wrapping policy; the expected-error FunctionTestCase registers immediate cleanup. The original object-[0]/[last] counterexamples now pass with real-array/direct-member controls, including varchar and binary-JSON executor paths.
Reviewed all 16 changed files, separately covering production, UTs and SQL/result deltas (no design-document delta). The implementation reuses the existing ByteJSON modifier/rebuilder, constructor conversion and prepared parameter metadata; it does not add a second JSON execution path. Checked left-to-right pair effects, append/reverse underflow, absent/non-array parents, SQL NULL versus JSON null, invalid terminals/wildcards/ranges, size/depth admission, binary FLOAT execution, and existing shared callers. Cost remains proportional to document/array copying per effective pair, including the existing repeated-copy cost for multiple pairs; no throughput improvement is claimed and no new benchmark framework is warranted.
The unrelated SYSDATE/SLEEP correction keeps the lower-bound and successful-return assertions: scheduling can resume later than the requested two seconds, so exact equality was not the promised behavior. It does not weaken a product upper-bound latency guarantee. Existing case count and production timer semantics are unchanged.
Fresh reviewer execution on this head (Go 1.27.0, Darwin arm64, native libraries rebuilt through make cgo):
- Complete pkg/container/bytejson: PASS, exit 0.
- Focused ARRAY_INSERT/strict-parent/depth/error tests, function dispatch and fixed function IDs: PASS.
- Planner prepared JSON value-position regression and actual MYSQL_TYPE_FLOAT binary frontend execution: PASS.
- git diff --check: PASS.
A first raw go-test invocation failed to load local native libraries and executed no test; the controlled, freshly built runs above supersede that setup attempt. No live service BVT, race or benchmark is newly claimed here. Author full owning-package/BVT evidence is reused only for unchanged semantic closure and remains bound to its recorded revision.
Current-head CI Required/SCA/UT/PROXY/pessimistic BVT/coverage checks are green. Actual main was refreshed as 56478b6; function ID 586 is still unallocated there, while 584/585 retain their existing definitions. Recheck allocation if landing main changes. The existing series design applies; broader issue #28033 and deployed QA are not declared complete by approval of this partial feature. Mixed-version rolling-upgrade testing is outside this requested review scope.
Merge Queue Status
This pull request spent 50 minutes 14 seconds in the queue, with no time running CI. ReasonPull request #29519 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? - [ ] API-change - [ ] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [x] Test and CI - [ ] Code Refactoring ## 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](https://github.com/mysql/mysql-server/blob/mysql-8.0.40/sql/item_json_func.cc#L2176-L2255), its [SQL NULL to JSON null conversion](https://github.com/mysql/mysql-server/blob/mysql-8.0.40/sql/item_json_func.cc#L1646-L1658), and the [official NULL MTR case](https://github.com/mysql/mysql-server/blob/mysql-8.0.40/mysql-test/suite/json/r/json_functions_innodb.result#L4824-L4830): 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: - The corrected function tests fail with the previous NULL shortcut restored and pass after its removal. - CGO-enabled `TestJsonArrayInsert`: PASS; complete `pkg/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. - Complete `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](#29519), already merged as `d33bb6e8b926f150b78f97249ae73da7b2a98a4e` and 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. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
What type of PR is this?
Which issue(s) this PR fixes:
issue #28033 (partial delivery; QA required)
What this PR does / why we need it:
Implements the MySQL-compatible
JSON_ARRAY_INSERTincrement for issue #28033. This partial increment does not close the broader issue. Ready is preserved.Contract
Insert before simple array-index terminals, including
last/last-N; append forward out-of-range indexes and clamp reverse underflow to the head. Apply pairs left-to-right; missing/non-array parents are no-ops. SQL NULL document/path returns SQL NULL; NULL values insert JSON null. Invalid terminals and existing document/path limits remain enforced. Values use the shared JSON constructor conversion, including concrete prepared binary FLOAT metadata.2026-10-08 maintenance
22910ec607b8cbf0ea847c7dc0d98af5749fefaf; original source:604353a1fe7c425fd59eebc1e2b25bb1128b4d14.bab4b3286a0dd5683a9b291763817722233e586c. JSON_ARRAY_INSERT uses function ID 586, preserving main's already allocated IDs 584/585; registry boundary becomes 587. Recheck the registry against actual main at landing.func_json_array_insert.sql, 22/22 statements twice on the freshly built owned single-CN service; zero failures, ignored or abnormal results. Runner b95f5c09930c42bdbe77828b6ae72d39f2be48ed / Java17.0.15; SQL/result inputs copied byte-identically, no result regeneration. Canonical DROP and repeat execution succeed.git diff --check.CI, review and QA
The original-head proxy/pessimistic BVT jobs failed on an unauthorized MinIO image pull before SQL execution; aggregate coverage lacked upstream artifacts. This is setup/tooling evidence, not a demonstrated JSON_ARRAY_INSERT test failure. No hourly/manual blind rerun was issued. The new head starts new CI; its result is pending.
No unresolved review thread was present at the verified original head. Historical semantic preflight and BVT receipts are not promoted to this new head; the current evidence is listed above. Deployed/mixed-version QA, current required CI, formal review and broader #28033 scope remain separate gates. No issue closure, QA handoff or merge is claimed.
2026-10-08 strict ARRAY_INSERT parent lookup follow-up
Current repair head:
d31fb6c6dedbb0af83386e033a8ecd81f865ea7b; target/validation base:bab4b3286a0dd5683a9b291763817722233e586c.The common simple-path resolver now has explicit scalar/object wrapping policy. ARRAY_INSERT alone disables both while seeking its parent; existing callers keep their prior behavior. Intermediate object
[0]/[last]paths leave the document unchanged, while real-array and direct-member paths still insert. The invalid-terminal test registers immediate fixture cleanup.Validation: complete ByteJSON and function packages passed (10,652 named test/subtest PASS events), configured owning-package lint reported 0 issues, and diff check passed. The 12-row parent/index-kind matrix and varchar/binary-JSON executor counterexamples pass. On the original source, object-zero/object-last counterexamples FAIL while object-one control PASS with matching native inputs. Canonical
test/distributed/cases/function/func_json_array_insert.sql/.resultpassed 28/28 twice on one ready owned instance, zero failed/ignored/abnormal; service stopped. Default SIMD service build hit a Go compiler crash; repository-supportedARCHSIMD=0build and subsequent SQL BVT passed. No SIMD validation claim is made. Fresh CI belongs to this new head and remains pending. Historical evidence above keeps its original revision.QA required: yes — this scoped repair does not close deployment acceptance or umbrella issue #28033.
2026-10-08 CI timing-oracle follow-up
Published head:
eaf150ef44f95dfab77623f252de82b1c9be5678. The previous head's PROXY BVT run 37748550739 failed the existing SYSDATE/SLEEP oracle: a valid delayed resume returned three elapsed seconds instead of the asserted exactly two. The test now checks elapsed seconds >= 2 and successful SLEEP return 0; production code, sleeps, case count and other oracles are unchanged. Source SYSDATE reads call-time wall clock, and timer expiry does not promise an exact resume deadline. This is an oracle correction, not a product latency bound or a claim that the whole CI failure is resolved.Fresh supported CPU build PASS (Darwin arm64, Go1.27, ARCHSIMD=0). Canonical
func_datetime_now.test/.resultnormal comparison: 50/50 PASS twice on the same ready owned service, zero failures/ignored/abnormal. Additional SQL boundary controls reject zero/one-second deltas and accept two/three; fixture table absence was verified after each run and the service stopped. Diff check and incremental self-review PASS. No unrelated Go/race/benchmark validation is claimed for this SQL-test-only change. Local single-CN evidence does not replace new-head PROXY/multi-CN required CI.The old Coverage job reported an incomplete required producer profile and calculated no coverage verdict; it is not labeled a coverage-percentage defect. Old runs are superseded, not rerun. New-head CI and the existing requested Xu review remain separate pending gates. No associated issue closure or deployed QA acceptance is implied.