-
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.
Norvald H. Ryeng authoredProblem: 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