mirror of
https://github.com/MariaDB/server.git
synced 2025-11-18 07:48:43 +03:00
Bug#16315 XML: extractvalue() handles self badly
xml.result, xml.test: Adding test case. item_xmlfunc.cc: Adding a special function to handle "self" axis. Previously "child" and "self" were handled the same.
This commit is contained in:
@@ -65,6 +65,9 @@ c1
|
||||
SELECT extractValue(@xml,'/a/child::*');
|
||||
extractValue(@xml,'/a/child::*')
|
||||
b1 b2
|
||||
SELECT extractValue(@xml,'/a/self::*');
|
||||
extractValue(@xml,'/a/self::*')
|
||||
a1 a2
|
||||
SELECT extractValue(@xml,'/a/descendant::*');
|
||||
extractValue(@xml,'/a/descendant::*')
|
||||
b1 c1 b2
|
||||
@@ -546,3 +549,12 @@ select extractvalue('<a>A</a>','/<a>');
|
||||
ERROR HY000: XPATH syntax error: '>'
|
||||
select extractvalue('<a><b>b</b><b!>b!</b!></a>','//b!');
|
||||
ERROR HY000: XPATH syntax error: '!'
|
||||
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant::*');
|
||||
extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant::*')
|
||||
B C
|
||||
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/self::*');
|
||||
extractvalue('<a>A<b>B<c>C</c></b></a>','/a/self::*')
|
||||
A
|
||||
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant-or-self::*');
|
||||
extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant-or-self::*')
|
||||
A B C
|
||||
|
||||
@@ -23,6 +23,7 @@ SELECT extractValue(@xml,'/*/*');
|
||||
SELECT extractValue(@xml,'/*/*/*');
|
||||
|
||||
SELECT extractValue(@xml,'/a/child::*');
|
||||
SELECT extractValue(@xml,'/a/self::*');
|
||||
SELECT extractValue(@xml,'/a/descendant::*');
|
||||
SELECT extractValue(@xml,'/a/descendant-or-self::*');
|
||||
SELECT extractValue(@xml,'/a/attribute::*');
|
||||
@@ -243,3 +244,10 @@ select extractvalue('<a>A</a>','/<a>');
|
||||
#
|
||||
--error 1105
|
||||
select extractvalue('<a><b>b</b><b!>b!</b!></a>','//b!');
|
||||
|
||||
#
|
||||
# Bug #16315 XML: extractvalue() handles self badly
|
||||
#
|
||||
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant::*');
|
||||
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/self::*');
|
||||
select extractvalue('<a>A<b>B<c>C</c></b></a>','/a/descendant-or-self::*');
|
||||
|
||||
Reference in New Issue
Block a user