diff options
author | Alexander Barkov <bar@mariadb.com> | 2020-05-29 15:31:24 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2020-05-29 15:31:24 +0400 |
commit | a2932e86b5dcbc76bf2bef545cf942f202abd3e8 (patch) | |
tree | f98c0f9805cb6f189d2e4455c81bbcc024f1c94e | |
parent | a1b3bebe1f7f7221daf520e35b81e13c1478d189 (diff) | |
download | mariadb-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.cc | 3 |
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; |