Repository navigation
fix: support UpdateXML text() targets - #29364
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.
深度审查完成:head c09870b2ce3777c7ff4afe6764bf39a7848d8e1c,merge-base 44e5226a21。未发现阻塞问题,代码层面建议合并。
已覆盖全部 4 个变更文件,并追踪 XPath 编译、终端 text() 转换、descendant-or-self 展开、union 去重和源文本范围替换。与 MySQL 8.0.45 源码 对照,终端 text() 保留当前上下文、且仅在选中一个节点时替换的行为一致。编译后的 program 属于单次 executeXMLFunction 调用,UpdateXML 的原地转换不会污染 ExtractValue 或下一次调用。NULL、掩码、畸形 XML、取消及输入/输出/工作量预算仍沿现有路径处理,没有新增外部资源或跨调用共享状态。
目标 issue #29328 的两条原始复现均已映射到回归输入和明确的替换结果;14 个 text-target 单测还覆盖空元素、分段文本、CDATA、无匹配、多目标、union、后代、文档及属性上下文,另有 NULL 场景。BVT 保留了既有 ExtractValue 和元素替换控制。
验证证据:复用当前 head 的成功 CI,包括函数包所在的 Ubuntu UT、ARM64 SCA、UT Coverage 和 PROXY/PESSIMISTIC 两组多 CN BVT。PR 另记录本地 XML 套件两次 63/63;本次没有重新启动服务或重跑该套件。当前 head 的 BVT 已成功,PR 描述中针对旧 head 9cb12c655f 的 MinIO 拉取失败不再代表当前 CI 状态。
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #29328.
What this PR does / why we need it:
UPDATEXMLrejected XPath expressions ending intext(). MySQL 8.0.45 parses terminaltext()without changing the current XPath context when choosing the source span for replacement. Normalize the terminal step toselffor UpdateXML only, retaining descendant behavior and union deduplication. This replaces the containing element or document when exactly one context node is selected; multiple targets leave the original XML unchanged.ExtractValueremains unchanged.Validation
./pkg/sql/plan/functiontests passed throughmo-cgo-testwith matching native artifacts.go vet -mod=readonly ./pkg/sql/plan/functionpassed. Incrementalgolangci-lint2.5.0 built with Go 1.26.4 reported 0 issues.gofmtandgit diff --checkpassed. Independent GPT-6 medium design and final whole-diff review found no blockers.9cb12c655ffound no additional correctness or performance change justified. Independent MySQL 8.0.45 checks confirmed terminaltext()behavior for root/nested/empty/split/CDATA text, descendant and union paths, parent/relative/document paths, and attribute contexts.CI status at
9cb12c655fShared build, Linux UT, UT coverage, and arm64 SCA passed. The PROXY and PESSIMISTIC Compose BVT jobs failed during topology startup: Docker could not pull the pinned Quay MinIO image (
unauthorized), before any MatrixOne SQL or BVT case ran. Coverage and CI Required are downstream failures. This is a shared CI dependency, tracked in #29367; these red checks do not establish an XML regression. Re-run both BVT topologies at this exact head after the image source is restored.Risk and rollback
The behavior change is limited to UpdateXML paths whose final step is
text(). Existing malformed XML, invalid XPath, warning, cancellation, and budget paths remain covered by the XML suite. SQL expected-output metadata for two warning-count columns and an empty warning set was refreshed to match the service output while retaining value assertions. Revert this commit to restore the previous rejection behavior.No distributed topology or GPU test was run locally; this is a scalar XML evaluator change.