• Michael Widenius's avatar
    Fixes bug when we run bcmp() on row when the storage engine hasn't filled in all fields in the row. · cd9706b2
    Michael Widenius authored
    This was triggered by innodb.innodb_multi_update, where we had a static length row without nulls and xtradb didn't fill in the delete-marker byte
    
    
    include/my_bitmap.h:
      Added prototype for bitmap_union_is_set_all()
    mysys/my_bitmap.c:
      Added function to check if union of two bit maps covers all bits.
    sql/mysql_priv.h:
      Updated protype for compare_record()
    sql/sql_insert.cc:
      Send to compare_record() flag if all fields are used.
    sql/sql_select.cc:
      Set share->null_bytes_for_compare.
    sql/sql_update.cc:
      In compare_record() don't use the fast cmp_record() (which is basically memcmp) if we don't know that all fields exists.
      Don't compare the null_bytes if there is no data there.
    sql/table.cc:
      Store in share->null_bytes_for_compare the number of bytes that has null or bit fields (but not delete marker)
      Store in can_cmp_whole_record if we can use memcmp() (assuming all rows are read) to compare rows in compare_record()
    sql/table.h:
      Added two elements in table->share to speed up checking how updated rows can be compared.
    cd9706b2
table.h 60.8 KB