~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-04-08 20:42:29 UTC
  • mto: (971.1.63 mordred)
  • mto: This revision was merged to the branch mainline in revision 990.
  • Revision ID: osullivan.padraig@gmail.com-20090408204229-okmeoxsqw21eav2o
Initial work on removing MY_BITMAP from the Drizzle code base. For a start,
I'm concentrating on removing the MY_BITMAP structures from the table
structure defined in drizzled/table.h

I'm replacing it with std::bitset for the moment unless I can think of a
better replacement. Still need to work on re-factoring the rest of the code
to work correctly with these changes that I have made.

Show diffs side-by-side

added added

removed removed

Lines of Context:
594
594
  TABLE_SHARE *share= table->s;
595
595
  HA_CREATE_INFO create_info;
596
596
  bool show_table_options= false;
597
 
  my_bitmap_map *old_map;
 
597
  bitset<MAX_FIELDS> *old_bitmap;
598
598
 
599
599
  restore_record(table, s->default_values); // Get empty record
600
600
 
621
621
    We have to restore the read_set if we are called from insert in case
622
622
    of row based replication.
623
623
  */
624
 
  old_map= table->use_all_columns(table->read_set);
 
624
  old_bitmap= table->use_all_columns(table->read_set);
625
625
 
626
626
  for (ptr=table->field ; (field= *ptr); ptr++)
627
627
  {
895
895
    append_directory(session, packet, "DATA",  create_info.data_file_name);
896
896
    append_directory(session, packet, "INDEX", create_info.index_file_name);
897
897
  }
898
 
  table->restore_column_map(old_map);
 
898
  table->restore_column_map(old_bitmap);
899
899
  return(0);
900
900
}
901
901
 
3011
3011
    if (!show_table->read_set)
3012
3012
    {
3013
3013
      /* to satisfy 'field->val_str' ASSERTs */
3014
 
      unsigned char *bitmaps;
3015
 
      uint32_t bitmap_size= show_table_share->column_bitmap_size;
3016
 
      if (!(bitmaps= (unsigned char*) alloc_root(session->mem_root, bitmap_size)))
3017
 
        return(0);
3018
 
      bitmap_init(&show_table->def_read_set,
3019
 
                  (my_bitmap_map*) bitmaps, show_table_share->fields, false);
3020
 
      bitmap_set_all(&show_table->def_read_set);
 
3014
      show_table->def_read_set.set();
3021
3015
      show_table->read_set= &show_table->def_read_set;
3022
3016
    }
3023
 
    bitmap_set_all(show_table->read_set);
 
3017
    show_table->read_set->set();
3024
3018
  }
3025
3019
 
3026
3020
  for (; (field= *ptr) ; ptr++)
3816
3810
                                 TMP_TABLE_ALL_COLUMNS),
3817
3811
                                HA_POS_ERROR, table_list->alias)))
3818
3812
    return(0);
3819
 
  my_bitmap_map* bitmaps=
3820
 
    (my_bitmap_map*) session->alloc(bitmap_buffer_size(field_count));
3821
 
  bitmap_init(&table->def_read_set, (my_bitmap_map*) bitmaps, field_count,
3822
 
              false);
 
3813
  table->def_read_set.set();
3823
3814
  table->read_set= &table->def_read_set;
3824
 
  bitmap_clear_all(table->read_set);
 
3815
  table->read_set->reset();
3825
3816
  table_list->schema_table_param= tmp_table_param;
3826
3817
  return(table);
3827
3818
}