Repository navigation
Conversation
VioletQwQ-0
force-pushed
the
codex/issue-28071-json-value-composites
branch
from
September 4, 2026 06:59
353e6c5 to
c6da227
Compare
VioletQwQ-0
marked this pull request as ready for review
September 4, 2026 07:49
VioletQwQ-0
requested review from
LeftHandCold,
XuPeng-SH,
aptend and
aunjgr
as code owners
September 4, 2026 07:49
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? |
This was referenced Sep 7, 2026
XuPeng-SH
pushed a commit
that referenced
this pull request
Sep 7, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue #28042 ## What this PR does / why we need it: `JSON_UNQUOTE` treats SQL text as a JSON string only when the first and last bytes are both double quotes. Ordinary text, JSON-looking object/array/number text, one-sided quotes, and text with outer whitespace are returned unchanged. Fully quote-framed malformed strings and invalid UTF-8 still return errors, while typed JSON input keeps its canonical unquote behavior. The result keeps the source CHAR/VARCHAR/TEXT capacity, including MEDIUMTEXT and LONGTEXT bounds, and always publishes `utf8mb4_bin` result metadata. CTAS therefore preserves both the source capacity and binary collation identity. Non-string scalar inputs such as DATE/TIME/numeric values are rejected before generic string casts can enter the passthrough path. Binary domains remain visible through binding so NULL propagates as SQL NULL. Non-NULL BINARY, VARBINARY, BLOB, and binary-charset values reach execution and return the binary-domain error. This head is based on `upstream/main` `4fdb9e91615f9fc37703039ae28a47849206d1d6`, which includes #28089. Validation on exact head `9a581373a942617ad536d8ecd3c5556c50b0d2ac`: - JSON_UNQUOTE focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestJsonUnquote' ./pkg/sql/plan/function` - CTAS metadata focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestBuildCTASPreservesJsonUnquoteTextBounds' ./pkg/sql/plan` - Owning packages: PASS — `pkg/sql/plan/function` and `pkg/sql/plan` through `mo-cgo-test` - Final binary build: PASS — `make build` - Direct SQL smoke on an isolated single-CN instance: PASS — typed binary NULL and NULL BLOB propagate NULL; DATE input is rejected before implicit cast; non-NULL binary input returns the execution error; CTAS reports binary result collation and source bounds. - BVT fixture: `test/distributed/cases/function/func_json_unquote.sql` and `.result` updated for these cases. Local mo-tester execution is pending because this macOS host has no Java runtime; exact-head CI must supply the public-path BVT evidence. - `git diff --check`: PASS - `mo-self-review`: PASS - Semantic preflight schema v7: `PASS semantic=PASS`; diff hash `a44f95565f5343965d3ab3e469d4eb451591b93c07ef2714e7847ec18923f99f` QA Required: yes. The SQL value, protocol metadata, domain-error, and CTAS contracts require fresh exact-head CI/BVT and QA verification before merge. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28071 ## What this PR does / why we need it: `JSON_VALUE` returned SQL `NULL` when a path selected one JSON object or array. That wrong value could be persisted by a STORED generated column and indexed, causing index queries to miss rows. This removes the composite-value shortcut and sends every non-null single match through `ByteJson.Unquote()`. Objects and arrays now return canonical JSON text, while scalar, JSON null, missing-path, multi-match, and invalid-input behavior stays unchanged. The result matches the current MySQL 8.0 [MTR input](https://github.com/mysql/mysql-server/blob/9fc8d60003b4eee32767c1e30942f222c3508c31/mysql-test/suite/json/t/json_value.test#L83-L86) and [expected output](https://github.com/mysql/mysql-server/blob/9fc8d60003b4eee32767c1e30942f222c3508c31/mysql-test/suite/json/r/json_value.result#L189-L198). Regression coverage includes VARCHAR and `T_json` input, root/nested/empty/unique-wildcard composites, STORED generated-column persistence, forced secondary-index reads, and scalar-to-array update maintenance. Historical STORED generated values are not recomputed automatically. QA must create affected data and its index on the old version, upgrade, confirm the stale value remains, then verify recovery by dropping the dependent index, dropping and recreating the generated column with its original definition, and recreating the index. Both full-scan and `FORCE INDEX` array/object queries must pass after recovery. Validation and exact-head evidence: - Previous head `c6da227ae94c75a68f1bc2557a415b99febeea67`: focused `TestJsonValue` (including invalid JSON document/path errors), `pkg/sql/plan/function`, final binary build, and single-CN `func_json_value.test` twice (44/44 each): PASS. - Rebase verification: `git range-diff` maps both PR commits 1:1 onto current head `93478345d163f437ce75a281ccedc432c64b0aa1`; no semantic patch change. - Current head `93478345d163f437ce75a281ccedc432c64b0aa1`: `git diff --check`: PASS; schema-v6 semantic preflight: `PASS semantic=PASS`, diff hash `cda0fc93541ef16c013a71762e35e99cc8c96e4a62faa5343ce361520b17355b`. - Current exact-head CI run `34079746431`: in progress (shared build passed; UT, coverage, and arm64 SCA running). - Local CGo `TestJsonValue` rerun: blocked because this temporary worktree has no `cgo/libmo.dylib`; CI is the authoritative current-head execution. QA Required, including the old-version-to-new-version generated-column/index upgrade and recovery scenario above. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28042 ## What this PR does / why we need it: `JSON_UNQUOTE` treats SQL text as a JSON string only when the first and last bytes are both double quotes. Ordinary text, JSON-looking object/array/number text, one-sided quotes, and text with outer whitespace are returned unchanged. Fully quote-framed malformed strings and invalid UTF-8 still return errors, while typed JSON input keeps its canonical unquote behavior. The result keeps the source CHAR/VARCHAR/TEXT capacity, including MEDIUMTEXT and LONGTEXT bounds, and always publishes `utf8mb4_bin` result metadata. CTAS therefore preserves both the source capacity and binary collation identity. Non-string scalar inputs such as DATE/TIME/numeric values are rejected before generic string casts can enter the passthrough path. Binary domains remain visible through binding so NULL propagates as SQL NULL. Non-NULL BINARY, VARBINARY, BLOB, and binary-charset values reach execution and return the binary-domain error. This head is based on `upstream/main` `4fdb9e91615f9fc37703039ae28a47849206d1d6`, which includes matrixorigin#28089. Validation on exact head `9a581373a942617ad536d8ecd3c5556c50b0d2ac`: - JSON_UNQUOTE focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestJsonUnquote' ./pkg/sql/plan/function` - CTAS metadata focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestBuildCTASPreservesJsonUnquoteTextBounds' ./pkg/sql/plan` - Owning packages: PASS — `pkg/sql/plan/function` and `pkg/sql/plan` through `mo-cgo-test` - Final binary build: PASS — `make build` - Direct SQL smoke on an isolated single-CN instance: PASS — typed binary NULL and NULL BLOB propagate NULL; DATE input is rejected before implicit cast; non-NULL binary input returns the execution error; CTAS reports binary result collation and source bounds. - BVT fixture: `test/distributed/cases/function/func_json_unquote.sql` and `.result` updated for these cases. Local mo-tester execution is pending because this macOS host has no Java runtime; exact-head CI must supply the public-path BVT evidence. - `git diff --check`: PASS - `mo-self-review`: PASS - Semantic preflight schema v7: `PASS semantic=PASS`; diff hash `a44f95565f5343965d3ab3e469d4eb451591b93c07ef2714e7847ec18923f99f` QA Required: yes. The SQL value, protocol metadata, domain-error, and CTAS contracts require fresh exact-head CI/BVT and QA verification before merge. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28071 ## What this PR does / why we need it: `JSON_VALUE` returned SQL `NULL` when a path selected one JSON object or array. That wrong value could be persisted by a STORED generated column and indexed, causing index queries to miss rows. This removes the composite-value shortcut and sends every non-null single match through `ByteJson.Unquote()`. Objects and arrays now return canonical JSON text, while scalar, JSON null, missing-path, multi-match, and invalid-input behavior stays unchanged. The result matches the current MySQL 8.0 [MTR input](https://github.com/mysql/mysql-server/blob/9fc8d60003b4eee32767c1e30942f222c3508c31/mysql-test/suite/json/t/json_value.test#L83-L86) and [expected output](https://github.com/mysql/mysql-server/blob/9fc8d60003b4eee32767c1e30942f222c3508c31/mysql-test/suite/json/r/json_value.result#L189-L198). Regression coverage includes VARCHAR and `T_json` input, root/nested/empty/unique-wildcard composites, STORED generated-column persistence, forced secondary-index reads, and scalar-to-array update maintenance. Historical STORED generated values are not recomputed automatically. QA must create affected data and its index on the old version, upgrade, confirm the stale value remains, then verify recovery by dropping the dependent index, dropping and recreating the generated column with its original definition, and recreating the index. Both full-scan and `FORCE INDEX` array/object queries must pass after recovery. Validation and exact-head evidence: - Previous head `c6da227ae94c75a68f1bc2557a415b99febeea67`: focused `TestJsonValue` (including invalid JSON document/path errors), `pkg/sql/plan/function`, final binary build, and single-CN `func_json_value.test` twice (44/44 each): PASS. - Rebase verification: `git range-diff` maps both PR commits 1:1 onto current head `93478345d163f437ce75a281ccedc432c64b0aa1`; no semantic patch change. - Current head `93478345d163f437ce75a281ccedc432c64b0aa1`: `git diff --check`: PASS; schema-v6 semantic preflight: `PASS semantic=PASS`, diff hash `cda0fc93541ef16c013a71762e35e99cc8c96e4a62faa5343ce361520b17355b`. - Current exact-head CI run `34079746431`: in progress (shared build passed; UT, coverage, and arm64 SCA running). - Local CGo `TestJsonValue` rerun: blocked because this temporary worktree has no `cgo/libmo.dylib`; CI is the authoritative current-head execution. QA Required, including the old-version-to-new-version generated-column/index upgrade and recovery scenario above. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28042 ## What this PR does / why we need it: `JSON_UNQUOTE` treats SQL text as a JSON string only when the first and last bytes are both double quotes. Ordinary text, JSON-looking object/array/number text, one-sided quotes, and text with outer whitespace are returned unchanged. Fully quote-framed malformed strings and invalid UTF-8 still return errors, while typed JSON input keeps its canonical unquote behavior. The result keeps the source CHAR/VARCHAR/TEXT capacity, including MEDIUMTEXT and LONGTEXT bounds, and always publishes `utf8mb4_bin` result metadata. CTAS therefore preserves both the source capacity and binary collation identity. Non-string scalar inputs such as DATE/TIME/numeric values are rejected before generic string casts can enter the passthrough path. Binary domains remain visible through binding so NULL propagates as SQL NULL. Non-NULL BINARY, VARBINARY, BLOB, and binary-charset values reach execution and return the binary-domain error. This head is based on `upstream/main` `4fdb9e91615f9fc37703039ae28a47849206d1d6`, which includes matrixorigin#28089. Validation on exact head `9a581373a942617ad536d8ecd3c5556c50b0d2ac`: - JSON_UNQUOTE focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestJsonUnquote' ./pkg/sql/plan/function` - CTAS metadata focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestBuildCTASPreservesJsonUnquoteTextBounds' ./pkg/sql/plan` - Owning packages: PASS — `pkg/sql/plan/function` and `pkg/sql/plan` through `mo-cgo-test` - Final binary build: PASS — `make build` - Direct SQL smoke on an isolated single-CN instance: PASS — typed binary NULL and NULL BLOB propagate NULL; DATE input is rejected before implicit cast; non-NULL binary input returns the execution error; CTAS reports binary result collation and source bounds. - BVT fixture: `test/distributed/cases/function/func_json_unquote.sql` and `.result` updated for these cases. Local mo-tester execution is pending because this macOS host has no Java runtime; exact-head CI must supply the public-path BVT evidence. - `git diff --check`: PASS - `mo-self-review`: PASS - Semantic preflight schema v7: `PASS semantic=PASS`; diff hash `a44f95565f5343965d3ab3e469d4eb451591b93c07ef2714e7847ec18923f99f` QA Required: yes. The SQL value, protocol metadata, domain-error, and CTAS contracts require fresh exact-head CI/BVT and QA verification before merge. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28071 ## What this PR does / why we need it: `JSON_VALUE` returned SQL `NULL` when a path selected one JSON object or array. That wrong value could be persisted by a STORED generated column and indexed, causing index queries to miss rows. This removes the composite-value shortcut and sends every non-null single match through `ByteJson.Unquote()`. Objects and arrays now return canonical JSON text, while scalar, JSON null, missing-path, multi-match, and invalid-input behavior stays unchanged. The result matches the current MySQL 8.0 [MTR input](https://github.com/mysql/mysql-server/blob/9fc8d60003b4eee32767c1e30942f222c3508c31/mysql-test/suite/json/t/json_value.test#L83-L86) and [expected output](https://github.com/mysql/mysql-server/blob/9fc8d60003b4eee32767c1e30942f222c3508c31/mysql-test/suite/json/r/json_value.result#L189-L198). Regression coverage includes VARCHAR and `T_json` input, root/nested/empty/unique-wildcard composites, STORED generated-column persistence, forced secondary-index reads, and scalar-to-array update maintenance. Historical STORED generated values are not recomputed automatically. QA must create affected data and its index on the old version, upgrade, confirm the stale value remains, then verify recovery by dropping the dependent index, dropping and recreating the generated column with its original definition, and recreating the index. Both full-scan and `FORCE INDEX` array/object queries must pass after recovery. Validation and exact-head evidence: - Previous head `c6da227ae94c75a68f1bc2557a415b99febeea67`: focused `TestJsonValue` (including invalid JSON document/path errors), `pkg/sql/plan/function`, final binary build, and single-CN `func_json_value.test` twice (44/44 each): PASS. - Rebase verification: `git range-diff` maps both PR commits 1:1 onto current head `93478345d163f437ce75a281ccedc432c64b0aa1`; no semantic patch change. - Current head `93478345d163f437ce75a281ccedc432c64b0aa1`: `git diff --check`: PASS; schema-v6 semantic preflight: `PASS semantic=PASS`, diff hash `cda0fc93541ef16c013a71762e35e99cc8c96e4a62faa5343ce361520b17355b`. - Current exact-head CI run `34079746431`: in progress (shared build passed; UT, coverage, and arm64 SCA running). - Local CGo `TestJsonValue` rerun: blocked because this temporary worktree has no `cgo/libmo.dylib`; CI is the authoritative current-head execution. QA Required, including the old-version-to-new-version generated-column/index upgrade and recovery scenario above. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
VioletQwQ-0
added a commit
to VioletQwQ-0/matrixone
that referenced
this pull request
Sep 17, 2026
## What type of PR is this? - [ ] API-change - [x] BUG - [ ] Improvement - [ ] Documentation - [ ] Feature - [ ] Test and CI - [ ] Code Refactoring ## Which issue(s) this PR fixes: issue matrixorigin#28042 ## What this PR does / why we need it: `JSON_UNQUOTE` treats SQL text as a JSON string only when the first and last bytes are both double quotes. Ordinary text, JSON-looking object/array/number text, one-sided quotes, and text with outer whitespace are returned unchanged. Fully quote-framed malformed strings and invalid UTF-8 still return errors, while typed JSON input keeps its canonical unquote behavior. The result keeps the source CHAR/VARCHAR/TEXT capacity, including MEDIUMTEXT and LONGTEXT bounds, and always publishes `utf8mb4_bin` result metadata. CTAS therefore preserves both the source capacity and binary collation identity. Non-string scalar inputs such as DATE/TIME/numeric values are rejected before generic string casts can enter the passthrough path. Binary domains remain visible through binding so NULL propagates as SQL NULL. Non-NULL BINARY, VARBINARY, BLOB, and binary-charset values reach execution and return the binary-domain error. This head is based on `upstream/main` `4fdb9e91615f9fc37703039ae28a47849206d1d6`, which includes matrixorigin#28089. Validation on exact head `9a581373a942617ad536d8ecd3c5556c50b0d2ac`: - JSON_UNQUOTE focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestJsonUnquote' ./pkg/sql/plan/function` - CTAS metadata focused UT: PASS — `.agents/skills/mo-dev/scripts/mo-cgo-test -count=1 -timeout=180s -run 'TestBuildCTASPreservesJsonUnquoteTextBounds' ./pkg/sql/plan` - Owning packages: PASS — `pkg/sql/plan/function` and `pkg/sql/plan` through `mo-cgo-test` - Final binary build: PASS — `make build` - Direct SQL smoke on an isolated single-CN instance: PASS — typed binary NULL and NULL BLOB propagate NULL; DATE input is rejected before implicit cast; non-NULL binary input returns the execution error; CTAS reports binary result collation and source bounds. - BVT fixture: `test/distributed/cases/function/func_json_unquote.sql` and `.result` updated for these cases. Local mo-tester execution is pending because this macOS host has no Java runtime; exact-head CI must supply the public-path BVT evidence. - `git diff --check`: PASS - `mo-self-review`: PASS - Semantic preflight schema v7: `PASS semantic=PASS`; diff hash `a44f95565f5343965d3ab3e469d4eb451591b93c07ef2714e7847ec18923f99f` QA Required: yes. The SQL value, protocol metadata, domain-error, and CTAS contracts require fresh exact-head CI/BVT and QA verification before merge. --------- Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
issue #28071
What this PR does / why we need it:
JSON_VALUEreturned SQLNULLwhen a path selected one JSON object or array. That wrong value could be persisted by a STORED generated column and indexed, causing index queries to miss rows.This removes the composite-value shortcut and sends every non-null single match through
ByteJson.Unquote(). Objects and arrays now return canonical JSON text, while scalar, JSON null, missing-path, multi-match, and invalid-input behavior stays unchanged. The result matches the current MySQL 8.0 MTR input and expected output.Regression coverage includes VARCHAR and
T_jsoninput, root/nested/empty/unique-wildcard composites, STORED generated-column persistence, forced secondary-index reads, and scalar-to-array update maintenance.Historical STORED generated values are not recomputed automatically. QA must create affected data and its index on the old version, upgrade, confirm the stale value remains, then verify recovery by dropping the dependent index, dropping and recreating the generated column with its original definition, and recreating the index. Both full-scan and
FORCE INDEXarray/object queries must pass after recovery.Validation and exact-head evidence:
c6da227ae94c75a68f1bc2557a415b99febeea67: focusedTestJsonValue(including invalid JSON document/path errors),pkg/sql/plan/function, final binary build, and single-CNfunc_json_value.testtwice (44/44 each): PASS.git range-diffmaps both PR commits 1:1 onto current head93478345d163f437ce75a281ccedc432c64b0aa1; no semantic patch change.93478345d163f437ce75a281ccedc432c64b0aa1:git diff --check: PASS; schema-v6 semantic preflight:PASS semantic=PASS, diff hashcda0fc93541ef16c013a71762e35e99cc8c96e4a62faa5343ce361520b17355b.34079746431: in progress (shared build passed; UT, coverage, and arm64 SCA running).TestJsonValuererun: blocked because this temporary worktree has nocgo/libmo.dylib; CI is the authoritative current-head execution.QA Required, including the old-version-to-new-version generated-column/index upgrade and recovery scenario above.