mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#38227 EXTRACTVALUE doesn't work with DTD declarations
Problem: XML syntax parser allowed to use quoted strings as attribute names, and tried to put them into parser state stack instead of identifiers. After that parser failed, if quoted string contained some slash characters. Fix: - Disallowing quoted strings in regular tags. - Allowing quoted string in DOCTYPE declararion, but don't push it into parse state stack (just skip it).
This commit is contained in:
@@ -551,4 +551,29 @@ INSERT INTO t1 VALUES (0), (0);
|
||||
SELECT 1 FROM t1 ORDER BY(UPDATEXML(a, '1', '1'));
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# BUG#38227 EXTRACTVALUE doesn't work with DTD declarations
|
||||
#
|
||||
# Check that quoted strings work fine in DOCTYPE declaration.
|
||||
#
|
||||
|
||||
SET @xml=
|
||||
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title> Title - document with document declaration</title>
|
||||
</head>
|
||||
<body> Hi, Im a webpage with document a declaration </body>
|
||||
</html>';
|
||||
|
||||
SELECT ExtractValue(@xml, 'html/head/title');
|
||||
SELECT ExtractValue(@xml, 'html/body');
|
||||
|
||||
# These two documents will fail.
|
||||
# Quoted strings are not allowed in regular tags
|
||||
#
|
||||
SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml');
|
||||
SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml');
|
||||
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
Reference in New Issue
Block a user