summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-05-29 15:31:24 +0400
committerAlexander Barkov <bar@mariadb.com>2020-05-29 15:31:24 +0400
commita2932e86b5dcbc76bf2bef545cf942f202abd3e8 (patch)
treef98c0f9805cb6f189d2e4455c81bbcc024f1c94e
parenta1b3bebe1f7f7221daf520e35b81e13c1478d189 (diff)
downloadmariadb-git-a2932e86b5dcbc76bf2bef545cf942f202abd3e8.tar.gz
MDEV-22744 *SAN: sql/item_xmlfunc.cc:791:43: runtime error: downcast of address ... which does not point to an object of type 'Item_func' note: object is of type 'Item_bool' (on optimized builds)
In Item_nodeset_func_predicate::val_nodeset, args[1] is not necessarily an Item_func descendant. It can be Item_bool. Removing a wrong cast. It was not really needed anyway.
-rw-r--r--sql/item_xmlfunc.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index d33cd30a928..97ef24b0851 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -797,7 +797,6 @@ String *Item_nodeset_func_attributebyname::val_nodeset(String *nodeset)
String *Item_nodeset_func_predicate::val_nodeset(String *str)
{
Item_nodeset_func *nodeset_func= (Item_nodeset_func*) args[0];
- Item_func *comp_func= (Item_func*)args[1];
uint pos= 0, size;
prepare(str);
size= fltend - fltbeg;
@@ -807,7 +806,7 @@ String *Item_nodeset_func_predicate::val_nodeset(String *str)
((XPathFilter*)(&nodeset_func->context_cache))->append_element(flt->num,
flt->pos,
size);
- if (comp_func->val_int())
+ if (args[1]->val_int())
((XPathFilter*)str)->append_element(flt->num, pos++);
}
return str;