1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #12375190: UPDATEXML CRASHES ON SIMPLE INPUTS

The XPATH implementation was not handling correctly the XPATH 
production #19 
(http://www.w3.org/TR/1999/REC-xpath-19991116/#node-sets),
namely

PathExpr ::= | FilterExpr '/' RelativeLocationPath
                    | FilterExpr '//' RelativeLocationPath

It was lacking context for the RelativeLocationPath and it was just 
ignoring the second slash instead of treating it as a different axis 
specifier.
Fixed the above two problems and added a test case.
This commit is contained in:
Georgi Kodinov
2011-05-03 10:48:24 +03:00
parent ae154449f1
commit 01b68c5105
3 changed files with 46 additions and 2 deletions

View File

@ -1144,5 +1144,23 @@ SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0)
NULL
#
# Bug#12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
#
SELECT UPDATEXML('','(a)/a','');
UPDATEXML('','(a)/a','')
SELECT UPDATEXML('<a><a>x</a></a>','(a)/a','<b />');
UPDATEXML('<a><a>x</a></a>','(a)/a','<b />')
<a><b /></a>
SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />');
UPDATEXML('<a><c><a>x</a></c></a>','(a)/a','<b />')
<a><c><a>x</a></c></a>
SELECT UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />');
UPDATEXML('<a><c><a>x</a></c></a>','(a)//a','<b />')
<a><c><b /></c></a>
SELECT ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b');
ExtractValue('<a><a>aa</a><b>bb</b></a>','(a)/a|(a)/b')
aa bb
#
# End of 5.5 tests
#