MDEV-37262 XMLISVALID() schema validation function.#5177
Conversation
|
Alexey Botchkov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Code Review
This pull request introduces the new native function XMLISVALID to the type_xmltype plugin, adding comprehensive XML schema validation tests and registering the function descriptor. However, two critical issues must be addressed: the newly referenced source file item_func_xml_isvalid.cc is missing from the pull request, which will cause immediate build failures, and the raw pointer member m_data in Item_func_xml_isvalid is left uninitialized, risking undefined behavior or segmentation faults.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR adds a new XML Schema validation SQL function to the XMLTYPE plugin, together with a large in-plugin XML Schema parser/validator and an accompanying mysql-test suite to exercise common schema constructs.
Changes:
- Introduces
Item_func_xml_isvalidand registers a new native function plugin (XMLISVALID). - Adds a substantial XML Schema parsing + validation implementation in
item_func_xml_isvalid.cc. - Adds a comprehensive mysql-test (
type_xmltype_validation) with expected results.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/type_xmltype/sql_type_xmltype.h | Declares the Item_func_xml_isvalid Item class for the new function. |
| plugin/type_xmltype/plugin.cc | Registers the XMLISVALID native function plugin and factory. |
| plugin/type_xmltype/item_func_xml_isvalid.cc | Implements schema parsing and XML validation logic for XMLISVALID. |
| plugin/type_xmltype/mysql-test/type_xmltype/type_xmltype_validation.test | Adds extensive test coverage for schema constructs and data types. |
| plugin/type_xmltype/mysql-test/type_xmltype/type_xmltype_validation.result | Adds expected output for the new validation test suite. |
| plugin/type_xmltype/CMakeLists.txt | Adds the new implementation file to the plugin build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
abd944a to
d304961
Compare
XMLISVALID function added to the XMLTYPE plugin.
d304961 to
b757020
Compare
XMLVALID function added to the XMLTYPE plugin.