xml.result, xml.test:

Adding test.
item_xmlfunc.cc:
  Bug #18171 XML: ExtractValue: the XPath position() function crashes the server!
  Disallowing use of position() and last() without context.


sql/item_xmlfunc.cc:
  Bug #18171 XML: ExtractValue: the XPath position() function crashes the server!
  Disallowing use of position() and last() without context.
mysql-test/t/xml.test:
  Adding test.
mysql-test/r/xml.result:
  Adding test.
This commit is contained in:
unknown 2006-03-15 11:57:37 +04:00
commit 1dc87feb20
3 changed files with 17 additions and 2 deletions

View file

@ -1141,13 +1141,15 @@ static Item *create_func_round(MY_XPATH *xpath, Item **args, uint nargs)
static Item *create_func_last(MY_XPATH *xpath, Item **args, uint nargs)
{
return new Item_func_xpath_count(xpath->context, xpath->pxml);
return xpath->context ?
new Item_func_xpath_count(xpath->context, xpath->pxml) : NULL;
}
static Item *create_func_position(MY_XPATH *xpath, Item **args, uint nargs)
{
return new Item_func_xpath_position(xpath->context, xpath->pxml);
return xpath->context ?
new Item_func_xpath_position(xpath->context, xpath->pxml) : NULL;
}