• Tor Didriksen's avatar
    Bug#13871079 RQG_MYISAM_DML_ALTER_VALGRIND FAILS ON VALGRIND PN PB2 · 83d455be
    Tor Didriksen authored
    The class Copy_field contains a String tmp, 
    which may allocate memory on the heap.
    That means that all instances of Copy_field
    must be properly destroyed. Alas they are not.
    
    Solution: don't use Copy_field::tmp for copying
    from_field => tmp => to_field
    in do_field_string()
    
    
    sql/field.cc:
      In Field_set::val_str
      return empty string (of appropriate character set) for an empty set.
    sql/field.h:
      New private member in Field_enum: empty_set_string.
    sql/field_conv.cc:
      In do_field_string, use an auto variable for copying
      from_field => tmp => to_field
      rather than copy->tmp.
    83d455be
field.h 85.1 KB