• Mayank Prasad's avatar
    Bug#11766101 : 59140: LIKE CONCAT('%',@A,'%') DOESN'T MATCH WHEN @A CONTAINS LATIN1 STRING · 5fb35050
    Mayank Prasad authored
    Issue/Cause:
    Issue is of memory corruption.During optimization phase, pattern to be matched in where 
    clause, is prepared. This is done in Item_func_concat::val_str() function which forms the
    resultant string (tmp_value) and return its pointer. In caller, Item_func_like::fix_fields, 
    pattern is made to point to this string (tmp_value). In further processing, tmp_value is 
    getting modified which causes pattern to have changed/wrong values.
    
    Fix:
    Allocate its own memroy location in caller, copy value of resultant string (tmp_value) 
    into that and make pattern to point to that. This makes sure no further changes to 
    tmp_value will affect pattern.
    5fb35050
item_cmpfunc.cc 148 KB