• unknown's avatar
    Change create_field->offset to store offset from start of fields, independent of null bits. · d19e0585
    unknown authored
    Count null_bits separately from field offsets and adjust them in case of primary key parts.
    (Previously a CREATE TABLE with a lot of null fields that was part of a primary key caused MySQL to wrongly count the number of bytes needed to store null bits)
    This is a more complete bug fix for #6236
    
    
    mysql-test/r/alter_table.result:
      More test for bug #6236 (CREATE TABLE didn't properly count not null columns for primary keys)
    mysql-test/t/alter_table.test:
      More test for bug #6236 (CREATE TABLE didn't properly count not null columns for primary keys)
    sql/handler.h:
      Add counter for null fields
    sql/sql_table.cc:
      Change create_field->offset to store offset from start of fields, independent of null bits.
      Count null_bits separately from field offsets and adjust them in case of primary key parts.
    sql/unireg.cc:
      Change create_field->offset to store offset from start of fields, independent of null bits.
      Count null_bits separately from field offsets and adjust them in case of primary key parts.
    d19e0585
sql_table.cc 65 KB