Details
-
Bug
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
N/A
-
None
Description
Content of xs:any and xs:anyType is skipped through one shared item, MY_XML_VALIDATION_DATA::annotation, which counts nesting in m_level. If validation stops inside such content (row 1 is not well-formed), m_level keeps its value; reset_types() does not reset it. On the next row the closing tag of the skipped element only decrements the level, the closing tag of R pops the annotation, and the end check of R (required z) never runs.
SET @s= '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
<xs:element name="R"><xs:complexType><xs:sequence>
|
<xs:any/>
|
<xs:element name="z" type="xs:int"/>
|
</xs:sequence></xs:complexType></xs:element>
|
</xs:schema>'; |
CREATE TABLE t (id INT, x TEXT); |
INSERT INTO t VALUES (1, '<R><x><y>'), (2, '<R><x/></R>'); |
SELECT XMLISVALID('<R><x/></R>', @s); |
--echo # BUG if row 2 = 1, same document as above
|
SELECT id, XMLISVALID(x, @s) FROM t ORDER BY id; |
DROP TABLE t; |
13.2.0-MariaDB-asan-debug-log source revision: bd45fd917d4ef23ca1c4f62ca63473c08c03c8de
|
 |
SET @s= '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
<xs:element name="R"><xs:complexType><xs:sequence>
|
<xs:any/>
|
<xs:element name="z" type="xs:int"/>
|
</xs:sequence></xs:complexType></xs:element>
|
</xs:schema>';
|
CREATE TABLE t (id INT, x TEXT);
|
INSERT INTO t VALUES (1, '<R><x><y>'), (2, '<R><x/></R>');
|
SELECT XMLISVALID('<R><x/></R>', @s);
|
XMLISVALID('<R><x/></R>', @s)
|
0
|
# BUG if row 2 = 1, same document as above
|
SELECT id, XMLISVALID(x, @s) FROM t ORDER BY id;
|
id XMLISVALID(x, @s)
|
1 0
|
2 1
|
DROP TABLE t;
|
Attachments
Issue Links
- is caused by
-
MDEV-37262 XMLISVALID() schema validation function
-
- Stalled
-
- relates to
-
MDEV-40394 XML schema fails on self-referencing type.
-
- Closed
-