~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Monty Taylor
  • Date: 2009-08-24 14:57:56 UTC
  • mfrom: (1122 staging)
  • mto: This revision was merged to the branch mainline in revision 1124.
  • Revision ID: mordred@inaugust.com-20090824145756-7gw6t1l4ncgm455c
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1147
1147
  if (!(bitmaps= (my_bitmap_map*) alloc_root(&share->mem_root,
1148
1148
                                             share->column_bitmap_size)))
1149
1149
    goto err;
1150
 
  bitmap_init(&share->all_set, bitmaps, share->fields);
1151
 
  bitmap_set_all(&share->all_set);
 
1150
  share->all_set.init(bitmaps, share->fields);
 
1151
  share->all_set.setAll();
1152
1152
 
1153
1153
  if (handler_file)
1154
1154
    delete handler_file;
1414
1414
  bitmap_size= share->column_bitmap_size;
1415
1415
  if (!(bitmaps= (unsigned char*) alloc_root(&outparam->mem_root, bitmap_size*3)))
1416
1416
    goto err;
1417
 
  bitmap_init(&outparam->def_read_set,
1418
 
              (my_bitmap_map*) bitmaps, share->fields);
1419
 
  bitmap_init(&outparam->def_write_set,
1420
 
              (my_bitmap_map*) (bitmaps+bitmap_size), share->fields);
1421
 
  bitmap_init(&outparam->tmp_set,
1422
 
              (my_bitmap_map*) (bitmaps+bitmap_size*2), share->fields);
 
1417
  outparam->def_read_set.init((my_bitmap_map*) bitmaps, share->fields);
 
1418
  outparam->def_write_set.init((my_bitmap_map*) (bitmaps+bitmap_size), share->fields);
 
1419
  outparam->tmp_set.init((my_bitmap_map*) (bitmaps+bitmap_size*2), share->fields);
1423
1420
  outparam->default_column_bitmaps();
1424
1421
 
1425
1422
  /* The table struct is now initialized;  Open the table */
1737
1734
{
1738
1735
  uint32_t field_count= s->fields;
1739
1736
 
1740
 
  bitmap_init(&this->def_read_set, (my_bitmap_map*) bitmaps, field_count);
1741
 
  bitmap_init(&this->tmp_set, (my_bitmap_map*) (bitmaps+ bitmap_buffer_size(field_count)), field_count);
 
1737
  this->def_read_set.init((my_bitmap_map*) bitmaps, field_count);
 
1738
  this->tmp_set.init((my_bitmap_map*) (bitmaps+ bitmap_buffer_size(field_count)), field_count);
1742
1739
 
1743
1740
  /* write_set and all_set are copies of read_set */
1744
1741
  def_write_set= def_read_set;
1745
1742
  s->all_set= def_read_set;
1746
 
  bitmap_set_all(&this->s->all_set);
 
1743
  this->s->all_set.setAll();
1747
1744
  default_column_bitmaps();
1748
1745
}
1749
1746
 
1895
1892
    bitmap_clear_all(&table->def_read_set);
1896
1893
    bitmap_clear_all(&table->def_write_set);
1897
1894
  */
1898
 
  memset(def_read_set.bitmap, 0, s->column_bitmap_size*2);
 
1895
  def_read_set.clearAll();
 
1896
  def_write_set.clearAll();
1899
1897
  column_bitmaps_set(&def_read_set, &def_write_set);
1900
1898
}
1901
1899
 
1933
1931
 
1934
1932
void Table::mark_columns_used_by_index(uint32_t index)
1935
1933
{
1936
 
  MY_BITMAP *bitmap= &tmp_set;
 
1934
  MyBitmap *bitmap= &tmp_set;
1937
1935
 
1938
1936
  (void) file->extra(HA_EXTRA_KEYREAD);
1939
 
  bitmap_clear_all(bitmap);
 
1937
  bitmap->clearAll();
1940
1938
  mark_columns_used_by_index_no_reset(index, bitmap);
1941
1939
  column_bitmaps_set(bitmap, bitmap);
1942
1940
  return;
1974
1972
}
1975
1973
 
1976
1974
void Table::mark_columns_used_by_index_no_reset(uint32_t index,
1977
 
                                                MY_BITMAP *bitmap)
 
1975
                                                MyBitmap *bitmap)
1978
1976
{
1979
1977
  KEY_PART_INFO *key_part= key_info[index].key_part;
1980
1978
  KEY_PART_INFO *key_part_end= (key_part +
1981
1979
                                key_info[index].key_parts);
1982
1980
  for (;key_part != key_part_end; key_part++)
1983
 
    bitmap_set_bit(bitmap, key_part->fieldnr-1);
 
1981
    bitmap->setBit(key_part->fieldnr-1);
1984
1982
}
1985
1983
 
1986
1984
 
3345
3343
  return true;
3346
3344
}
3347
3345
 
3348
 
my_bitmap_map *Table::use_all_columns(MY_BITMAP *bitmap)
 
3346
my_bitmap_map *Table::use_all_columns(MyBitmap *bitmap)
3349
3347
{
3350
 
  my_bitmap_map *old= bitmap->bitmap;
3351
 
  bitmap->bitmap= s->all_set.bitmap;
 
3348
  my_bitmap_map *old= bitmap->getBitmap();
 
3349
  bitmap->setBitmap(s->all_set.getBitmap());
3352
3350
  return old;
3353
3351
}
3354
3352
 
3355
3353
void Table::restore_column_map(my_bitmap_map *old)
3356
3354
{
3357
 
  read_set->bitmap= old;
 
3355
  read_set->setBitmap(old);
3358
3356
}
3359
3357
 
3360
3358
uint32_t Table::find_shortest_key(const key_map *usable_keys)