4666
4666
read_set->bitmap= old;
4669
uint Table::find_shortest_key(const key_map *usable_keys)
4671
uint min_length= (uint) ~0;
4673
if (!usable_keys->is_clear_all())
4675
for (uint nr=0; nr < s->keys ; nr++)
4677
if (usable_keys->is_set(nr))
4679
if (key_info[nr].key_length < min_length)
4681
min_length= key_info[nr].key_length;
4690
/*****************************************************************************
4691
Remove duplicates from tmp table
4692
This should be recoded to add a unique index to the table and remove
4694
Table is a locked single thread table
4695
fields is the number of fields to check (from the end)
4696
*****************************************************************************/
4698
bool Table::compare_record(Field **ptr)
4700
for (; *ptr ; ptr++)
4702
if ((*ptr)->cmp_offset(s->rec_buff_length))
4708
/* Return false if row hasn't changed */
4710
bool Table::compare_record()
4712
if (s->blob_fields + s->varchar_fields == 0)
4713
return cmp_record(this, record[1]);
4714
/* Compare null bits */
4715
if (memcmp(null_flags,
4716
null_flags + s->rec_buff_length,
4718
return true; // Diff in NULL value
4719
/* Compare updated fields */
4720
for (Field **ptr= field ; *ptr ; ptr++)
4722
if (bitmap_is_set(write_set, (*ptr)->field_index) &&
4723
(*ptr)->cmp_binary_offset(s->rec_buff_length))
4670
4733
/*****************************************************************************
4671
4734
The different ways to read a record