Repository navigation
feat(sql): support bounded XML functions - #29179
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? |
eb59a6a to
afc10e3
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed all changed hunks at exact head 2d98d0122118f936234ef07e09767fcaa48f65bc against 57c280ed48fdccec3c2eb25042820deaf1eca3c1.
P1 remains: docs/design/mysql_xml_functions.md:3 lacks explicit authorized-maintainer acceptance of the exact design artifact. The document still says revision 2, but its current blob is 5f2dde64da0a75e52adbfd08a7a7d5cdbf6081e2, replacing bb99f4dce1ede4c5ed12630ca29e7a3acf84e8ba. Acceptance must include the descendant-text/count and QName amendments. AI/parent claims, the empty earlier APPROVE and ordinary implementation reviews do not satisfy this gate.
The four prior code findings are fixed: child-literal text-record comparison, attribute self context under //, descendant text() evaluation and malformed QName rejection. No additional concrete implementation blocker was found.
Exact-head CI is green. The proxy/compose XML BVT passed 52/52; the earlier pessimistic 47/47 result is not current-head evidence. Coverage percentage was not a gate.
Internal recommendation: BLOCKED pending exact-design acceptance. COMMENT only because this PR is self-authored.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #28306
What this PR does / why we need it:
Adds
ExtractValue(xml, xpath)andUpdateXML(xml, xpath, replacement)with an explicitly documented bounded XPath subset. Supported paths include descendants, attributes, positional and literal predicates, unions, andcount(). Unsupported features fail explicitly rather than silently returning an empty result.Raw XML spans preserve entities, lexical prefixes, and unaffected replacement bytes. Malformed XML yields NULL with warning 1525; XPath validation precedes document/replacement NULL handling. Constant XPath expressions and prepared parameters are supported, with no cross-execution cache. Results have nullable LONGTEXT metadata so CTAS can safely retain values above VARCHAR capacity.
Untrusted inputs have byte, depth, node, AST, work and scratch limits. No external entity resolution, added dependencies, background workers, or persistent cache. IDs are append-only; all executing CNs must be upgraded before using the functions. This is not a complete XPath 1.0 implementation; see
docs/design/mysql_xml_functions.mdfor accepted scope and limits.Validation:
No CI result is claimed. Parent owns publication.