Skip to content
  • Norvald H. Ryeng's avatar
    afb29c5d
    Bug #11764818 57692: CRASH IN ITEM_FUNC_IN::VAL_INT() WITH ZEROFILL · afb29c5d
    Norvald H. Ryeng authored
    Problem: During optimization, ZEROFILL values may be converted to
    string constants. However, the IN function does not handle switching
    datatypes after planning, leading to IN finding a null pointer instead
    of its argument.
    
    Item_func_in creates a table of cmp_items, one for each datatype used
    in the comparison. This table is created during query planning by
    fix_length_and_dec(). During optimization,
    Item_field::equal_fields_propagator() converts ZEROFILL numbers to
    strings, but the comparison table in Item_func_in is not
    updated. During execution, the position in the comparison table is
    found by examining the result types of the fields to be
    compared. Since the result type of the fields have changed, the wrong
    position in the comparison table is inferred, and this position
    contains a null pointer.
    
    Fix: Set the cmp_context of arguments to Item_func_in so that
    Item_field::equal_fields_propagator() will not convert them to
    strings.
    afb29c5d
    Bug #11764818 57692: CRASH IN ITEM_FUNC_IN::VAL_INT() WITH ZEROFILL
    Norvald H. Ryeng authored
    Problem: During optimization, ZEROFILL values may be converted to
    string constants. However, the IN function does not handle switching
    datatypes after planning, leading to IN finding a null pointer instead
    of its argument.
    
    Item_func_in creates a table of cmp_items, one for each datatype used
    in the comparison. This table is created during query planning by
    fix_length_and_dec(). During optimization,
    Item_field::equal_fields_propagator() converts ZEROFILL numbers to
    strings, but the comparison table in Item_func_in is not
    updated. During execution, the position in the comparison table is
    found by examining the result types of the fields to be
    compared. Since the result type of the fields have changed, the wrong
    position in the comparison table is inferred, and this position
    contains a null pointer.
    
    Fix: Set the cmp_context of arguments to Item_func_in so that
    Item_field::equal_fields_propagator() will not convert them to
    strings.
Loading