Details
-
Bug
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
N/A
-
None
-
Q3/2026 Server Maintenance, Q3/2026 Server Development, Q4/2026 Server Maintenance
Description
set @s='<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
<xs:element name="r"><xs:complexType><xs:sequence><xs:element name="a" type="xs:int"/></xs:sequence></xs:complexType></xs:element></xs:schema>'; |
create table t1 (name varchar(20), doc text); |
insert into t1 values |
('empty', ''), |
('whitespace only', ' '), |
('text only', 'abc'), |
('comment only', '<!--c-->'), |
('two roots', '<r><a>1</a></r><r><a>1</a></r>'), |
('leading text', 'x<r><a>1</a></r>'), |
('trailing text', '<r><a>1</a></r>x'), |
('unclosed', '<r><a>1</a>'), |
('valid', '<r><a>1</a></r>'); |
select name, doc, XMLISVALID(doc, @s), CAST(doc AS XMLTYPE) from t1; |
MariaDB [test]> select name, doc, XMLISVALID(doc, @s), CAST(doc AS XMLTYPE) from t1;
|
+-----------------+--------------------------------+---------------------+----------------------+
|
| name | doc | XMLISVALID(doc, @s) | CAST(doc AS XMLTYPE) |
|
+-----------------+--------------------------------+---------------------+----------------------+
|
| empty | | 1 | NULL |
|
| whitespace only | | 1 | NULL |
|
| text only | abc | 1 | NULL |
|
| comment only | <!--c--> | 1 | NULL |
|
| two roots | <r><a>1</a></r><r><a>1</a></r> | 1 | NULL |
|
| leading text | x<r><a>1</a></r> | 1 | NULL |
|
| trailing text | <r><a>1</a></r>x | 1 | NULL |
|
| unclosed | <r><a>1</a> | 0 | NULL |
|
| valid | <r><a>1</a></r> | 1 | <r><a>1</a></r> |
|
+-----------------+--------------------------------+---------------------+----------------------+
|
9 rows in set (0,002 sec)
|
|
Attachments
Issue Links
- is caused by
-
MDEV-37262 XMLISVALID() schema validation function
-
- In Testing
-