Skip to content

Commit a2932e8

Browse files
committed
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.
1 parent a1b3beb commit a2932e8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sql/item_xmlfunc.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,6 @@ String *Item_nodeset_func_attributebyname::val_nodeset(String *nodeset)
797797
String *Item_nodeset_func_predicate::val_nodeset(String *str)
798798
{
799799
Item_nodeset_func *nodeset_func= (Item_nodeset_func*) args[0];
800-
Item_func *comp_func= (Item_func*)args[1];
801800
uint pos= 0, size;
802801
prepare(str);
803802
size= fltend - fltbeg;
@@ -807,7 +806,7 @@ String *Item_nodeset_func_predicate::val_nodeset(String *str)
807806
((XPathFilter*)(&nodeset_func->context_cache))->append_element(flt->num,
808807
flt->pos,
809808
size);
810-
if (comp_func->val_int())
809+
if (args[1]->val_int())
811810
((XPathFilter*)str)->append_element(flt->num, pos++);
812811
}
813812
return str;

0 commit comments

Comments
 (0)