Skip to content

MDEV-37262 XMLISVALID() schema validation function.#5177

Open
holyfoot wants to merge 1 commit into
mainfrom
bb-13.1-mdev-37262-hf
Open

MDEV-37262 XMLISVALID() schema validation function.#5177
holyfoot wants to merge 1 commit into
mainfrom
bb-13.1-mdev-37262-hf

Conversation

@holyfoot
Copy link
Copy Markdown
Contributor

@holyfoot holyfoot commented Jun 4, 2026

XMLVALID function added to the XMLTYPE plugin.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread plugin/type_xmltype/CMakeLists.txt
Comment thread plugin/type_xmltype/sql_type_xmltype.h
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_isvalid and 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.

Comment thread plugin/type_xmltype/plugin.cc
Comment thread plugin/type_xmltype/plugin.cc Outdated
Comment thread plugin/type_xmltype/item_func_xml_isvalid.cc
Comment thread plugin/type_xmltype/item_func_xml_isvalid.cc
Comment thread plugin/type_xmltype/item_func_xml_isvalid.cc
Comment thread plugin/type_xmltype/item_func_xml_isvalid.cc
Comment thread plugin/type_xmltype/item_func_xml_isvalid.cc
Comment thread plugin/type_xmltype/item_func_xml_isvalid.cc Outdated
Comment thread plugin/type_xmltype/item_func_xml_isvalid.cc Outdated
@holyfoot holyfoot force-pushed the bb-13.1-mdev-37262-hf branch 2 times, most recently from abd944a to d304961 Compare June 5, 2026 08:13
XMLISVALID function added to the XMLTYPE plugin.
@holyfoot holyfoot force-pushed the bb-13.1-mdev-37262-hf branch from d304961 to b757020 Compare June 5, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants