• unknown's avatar
    Fixed bug #16281: Multi-table update broken in 5.0 on tables imported from 4.1 · 0f8c1175
    unknown authored
    Mutli-table uses temporary table to store new values for fields. With the
    new values the rowid of the record to be updated is stored in a Field_string
    field. Table to be updated is set as source table of the rowid field.
    But when the temporary table creates the tmp field for the rowid field it
    converts it to a varstring field because the table to be updated was created by
    the v4.1. Due to this the stored rowids were broken and no records for 
    update were found.
    
    The flag can_alter_field_type is added to Field_string class. When it is set to
    0 the field won't be converted to varstring. The Field_string::type() function 
    now always returns MYSQL_TYPE_STRING if can_alter_field_type is set to 0.
    The multi_update::initialize_tables() function now sets can_alter_field_type
    flag to 0 for the rowid fields denying conversion of the field to a varstring
    field.
    
    
    
    sql/field.h:
      Fixed bug #16281: Multi-table update broken in 5.0 on tables imported from 4.1
      The flag can_alter_field_type is added to Field_string class. When it is set to
      0 the field won't be converted to varstring.
      The Field_string::type() function now always returns MYSQL_TYPE_STRING if 
      can_alter_field_type is set to 0.
    sql/sql_update.cc:
      Fixed bug #16281: Multi-table update broken in 5.0 on tables imported from 4.1
      The multi_update::initialize_tables() function now sets can_alter_field_type
      flag to 0 for the rowid fields denying conversion of the field to a varstring
      field.
    0f8c1175
sql_update.cc 43.9 KB