diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-02-04 15:40:12 +0400 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-02-04 15:40:12 +0400 |
commit | 1d09ec6208010830e20970531fcb8d7ff6f733d8 (patch) | |
tree | 2265883263b5da5d69ba026738ee0509931d8296 /mysql-test/t/xml.test | |
parent | ffdb6ac4bd610550c5c82f2d96bcb6129406ed25 (diff) | |
download | mariadb-git-1d09ec6208010830e20970531fcb8d7ff6f733d8.tar.gz |
Bug#42495 updatexml: Assertion failed: xpath->context, file .\item_xmlfunc.cc, line 2507
Problem:
RelativeLocationPath can appear only after a node-set expression
in the third and the fourth branches of this rule:
PathExpr :: = LocationPath
| FilterExpr
| FilterExpr '/' RelativeLocationPath
| FilterExpr '//' RelativeLocationPath
XPatch code didn't check the type of FilterExpr and crashed.
Fix:
If FilterExpr is a scalar expression
(variable reference, literal, number, scalar function call)
return error.
mysql-test/r/xml.result:
test result
mysql-test/t/xml.test:
test case
sql/item_xmlfunc.cc:
Problem:
RelativeLocationPath can appear only after a node-set expression
in the third and the fourth branches of this rule:
PathExpr :: = LocationPath
| FilterExpr
| FilterExpr '/' RelativeLocationPath
| FilterExpr '//' RelativeLocationPath
XPatch code didn't check the type of FilterExpr and crashed.
Fix:
If FilterExpr is a scalar expression
(variable reference, literal, number, scalar function call)
return error.
Diffstat (limited to 'mysql-test/t/xml.test')
-rw-r--r-- | mysql-test/t/xml.test | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index d840e14ba5f..74bce8dc962 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -575,5 +575,19 @@ SELECT ExtractValue(@xml, 'html/body'); SELECT ExtractValue('<xml "xxx" "yyy">CharData</xml>', '/xml'); SELECT ExtractValue('<xml xxx "yyy">CharData</xml>', '/xml'); +# +# Bug#42495 updatexml: Assertion failed: xpath->context, file .\item_xmlfunc.cc, line 2507 +# +set @x=10; +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','$@x/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','round(123.4)/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','1/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','"b"/a'); +--error ER_UNKNOWN_ERROR +select extractvalue('<a></a>','(1)/a'); --echo End of 5.1 tests |