Skip to content

[Compatibility]: UPDATEXML rejects text() node targets supported by MySQL #29328

Closed

Description

@Ariznawlll

Branch Name

main

Commit ID

95b1d2b

Other Environment Information

  • MatrixOne was built from the commit above and started locally with etc/launch/launch.toml.
  • MySQL comparison version: 8.0.45.
  • Each MatrixOne statement below was repeated three times with the same result.

Actual Behavior

MatrixOne rejects text() node targets in UPDATEXML before evaluating the document:

SELECT UPDATEXML('<a>x</a>', '/a/text()', 'q');
SELECT UPDATEXML('<a><b>x</b></a>', '/a/b/text()', 'q');

Both statements return:

ERROR 20105 (HY000): not supported: UpdateXML text() target is unsupported

The connection remains usable, and an adjacent element-target update succeeds:

SELECT UPDATEXML('<a><b>x</b></a>', '/a/b', '<q/>');
-- <a><q/></a>

Expected Behavior

MySQL 8.0.45 accepts the same XPath targets and replaces the selected text node:

UPDATEXML('<a>x</a>', '/a/text()', 'q')
q

UPDATEXML('<a><b>x</b></a>', '/a/b/text()', 'q')
<a>q</a>

UPDATEXML should support a single text-node target consistently with MySQL.

Steps to Reproduce

SELECT UPDATEXML('<a>x</a>', '/a/text()', 'q');
SELECT UPDATEXML('<a><b>x</b></a>', '/a/b/text()', 'q');
SELECT UPDATEXML('<a><b>x</b></a>', '/a/b', '<q/>');

Additional Information

The behavior is explicitly blocked in pkg/sql/plan/function/func_xml.go: after compiling the XPath, executeXMLFunction rejects any update path whose terminal step is text().

This is narrower than closed issue #28306, which tracked the previous absence of the entire ExtractValue and UpdateXML functions. The functions are now available; only the text-node update target remains unsupported.

MySQL reference: https://dev.mysql.com/doc/refman/8.0/en/xml-functions.html

Activity

  1. added this to the MO-202609 milestone on Sep 24, 2026
  2. added theissue type on Sep 24, 2026
  3. self-assigned this
    on Sep 24, 2026
  4. added a commit that references this issue on Sep 24, 2026
    a78e517
  5. Ariznawlll commented on Sep 27, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试版本

    • 分支:main
    • commit:5be6cd90b501da225be591ffffe6000bf01f515e
    • 部署方式:本地单机(1 CN / 1 TN / 1 LogService)
    • 测试日期:2026-09-27

    原问题验证

    在上述最新 main 上按 issue 原始复现步骤执行,并独立重复 3 次;3/3 均满足修复后的预期。当前 main 已包含修复提交 a78e517d9584c14e157e62efd43c5de9e9e89379。

    Happy Path 覆盖

    1. UPDATEXML 可更新根节点及嵌套节点的 text() target。

    Unhappy Path 覆盖

    1. 多 text() 命中路径保持原文不变,未再被 binder 拒绝。

    白盒验证

    确认修复提交 a78e517d9584c14e157e62efd43c5de9e9e89379 是当前 main 的祖先,并核对对应 MatrixOne BVT/实现路径;本次另以公开 SQL 协议执行黑盒验收。

    回归测试

    已加入 MOTR PR #204 的 issue_29323_29325_29327_29328_29329_29330_29331_sql_contracts.test,MOTR 提交 2b4462f2;本地基线比对连续 3 次通过。

    测试证据

    测试结论

    测试通过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/compatibilitykind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions