• unknown's avatar
    BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...." · 5f6606ec
    unknown authored
    avoid multiplying length of field_X by charset->mbmaxlen twice when calculating space 
    required for field_X in the new table.
    
    
    mysql-test/r/create.result:
      Testcase for BUG#14139
    mysql-test/t/create.test:
      Testcase for BUG#14139
    sql/field.cc:
      BUG#14139: Make create_length_to_internal_length() save length-in-characters in 
      create_field::chars_length.
    sql/field.h:
      BUG#14139: Add create_length::chars_length where we save length-in-characters, added comments.
    sql/sql_table.cc:
      BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
      we get two instances of create_field: (1) is occurence of field_X in create list, and (2) is
      in select list. If we figure they both refer to the same field, we "join" them according to
      some rule that is not explicitly specified anywhere.
      When we do this "join", create_field::length already contains length-in-bytes for both, so
      when we transfer field length (in characters) from (1) to (2), use length-in-characters that
      we have saved in create_length::chars_length.
    5f6606ec
field.h 49.2 KB