You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Compatibility]: JSON-to-character CAST unquotes JSON strings instead of serializing them #29471
main history; reproduced using the clean direct-parent benchmark binary for 1575e70c3db676d3ed00abc080aadc029b0e1435, fresh copy of its data snapshot, Linux amd64, local single CN on NVMe. Discovered while reviewing #29462; these ordinary SQL failures do not require prepared execution.
Actual behavior / reproduction
select cast(cast('"abc"'as json) asvarchar);
Observed character value: abc. Expected serialized JSON character value: "abc".
MySQL JSON conversion rules specify serialization for JSON-to-character conversion; unquoting belongs to JSON_UNQUOTE.
Root cause / scope
jsonToStr special-cases a JSON string with Unquote(), while other JSON categories use MarshalJSON(). Existing CAST-width and DML assignment tests rely on the unquoted payload, including truncation/trailing-space behavior, so changing this shared function requires an explicit CAST-versus-assignment compatibility review and updated independent SQL controls.
Related: #29462 (source binding review) and #28907 (JSON CONCAT). #29462 preserves the existing CAST/assignment behavior and implements CONCAT serialization at CONCAT's shared consumer boundary. This issue tracks the separate shared CAST/assignment contract; it is not claimed fixed by the performance PR.
select cast(cast('"abc"'as json) aschar);
-- actual character value: abcselect cast(cast('"中文🙂"'as json) aschar);
-- actual character value: 中文🙂select cast(cast('{"x":1}'as json) aschar);
-- actual: {"x": 1}
A broader 487-case boundary suite had 3 failures, all JSON-string serialization cases attributable to this existing issue. Object/numeric round-trips, JSON paths and Unicode extraction controls passed.
This is not a claim of regression on current main. The inspected main snapshot d9eb0e0ce88bec403dce4cd6c7fbdf15f19e1b03 has the explicit-CAST serialization branch and issue_29471_json_character_cast regression case. I have not run a main-built full server to revalidate that SQL fix. Leaving this issue closed; no duplicate issue created.
Activity
fix: restore prepared TPCC filter selectivity with per-binding proof (#…
fix: preserve prepared ROUND and TRUNCATE value domains (#29508)
Ariznawlll commentedon Oct 2, 2026
测试版本
maind50a2d475a406829f67127fef7b2ad4abc1c1d3dmo-service,独立数据目录;MySQL 文本协议与 server-side PREPARE原问题验证
按 issue 原始语义在上述 commit 重新执行并重复 3 次。JSON string 在结果中保留 JSON 引号,number/bool/null 仍保持各自 JSON 类别。
Happy Path 覆盖
覆盖标量 JSON 各类别和 CTAS/查询投影。
Unhappy Path 覆盖
覆盖 SQL NULL、JSON null、嵌套值与非法 JSON;无类型串化混淆。
白盒验证
关联修复 #29508、#29462 已进入当前
main。同时将本 issue 的可公开观察契约固化为独立回归,避免只依赖实现细节或共享测试间接判断。回归测试
suites/14_issue_regression/t/issue_recent_sql_semantics.test714/714条语句通过。测试证据
d50a2d475a406829f67127fef7b2ad4abc1c1d3d14_issue_regression中观察到的旧 GOROOT/历史 golden/并发锁冲突属于既有无关失败,以上新增用例单独重跑均稳定通过。测试结论
测试通过。
MatrixAdventurer commentedon Oct 6, 2026
Additional release-version reproduction from a local test-owned instance (2026-10-07 Asia/Shanghai).
1a44f3d, Linux x86_64.5d136df6fab5e7a5bdf4ba3e678470d898c8d681f3fdae99095ecd9c4205d2ed.A broader 487-case boundary suite had 3 failures, all JSON-string serialization cases attributable to this existing issue. Object/numeric round-trips, JSON paths and Unicode extraction controls passed.
This is not a claim of regression on current main. The inspected main snapshot
d9eb0e0ce88bec403dce4cd6c7fbdf15f19e1b03has the explicit-CAST serialization branch andissue_29471_json_character_castregression case. I have not run a main-built full server to revalidate that SQL fix. Leaving this issue closed; no duplicate issue created.