Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-42416

XMLISVALID ignores use, fixed and default in attribute and element declarations

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • N/A
    • 13.3
    • XML Functions
    • None

    Description

      use, fixed and default are declared as schema attributes, but the validator never reads them. MDEV-41821 listed the required and fixed cases; its fix left them out.

      --echo # BUG if 1
      SELECT XMLISVALID('<a/>', '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="a"><xs:complexType><xs:attribute name="b" type="xs:int" use="required"/></xs:complexType></xs:element></xs:schema>') required_missing;
      --echo # BUG if 1
      SELECT XMLISVALID('<a b="1"/>', '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="a"><xs:complexType><xs:attribute name="b" type="xs:int" use="prohibited"/></xs:complexType></xs:element></xs:schema>') prohibited;
      --echo # BUG if 1
      SELECT XMLISVALID('<a b="2"/>', '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="a"><xs:complexType><xs:attribute name="b" type="xs:int" fixed="1"/></xs:complexType></xs:element></xs:schema>') attr_fixed, XMLISVALID('<a>2</a>', '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="a" type="xs:int" fixed="1"/></xs:schema>') elem_fixed;
      --echo # BUG if 0
      SELECT XMLISVALID('<a/>', '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:element name="a" type="xs:int" default="1"/></xs:schema>') elem_default;

      Actual: 1, 1, 1 1, 0.

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.