~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_insert.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:
33
33
#include <drizzled/field/timestamp.h>
34
34
#include <drizzled/lock.h>
35
35
 
 
36
#include <bitset>
 
37
 
 
38
using namespace std;
 
39
 
36
40
 
37
41
/*
38
42
  Check if insert fields are correct.
721
725
{
722
726
  int error;
723
727
  char *key=0;
724
 
  MY_BITMAP *save_read_set, *save_write_set;
 
728
  bitset<MAX_FIELDS> *save_read_set, *save_write_set;
725
729
  uint64_t prev_insert_id= table->file->next_insert_id;
726
730
  uint64_t insert_id_for_cur_row= 0;
727
731
 
965
969
                                           TableList *)
966
970
{
967
971
  int err= 0;
968
 
  MY_BITMAP *write_set= entry->write_set;
 
972
  bitset<MAX_FIELDS> *write_set= entry->write_set;
969
973
 
970
974
  for (Field **field=entry->field ; *field ; field++)
971
975
  {
972
 
    if (!bitmap_is_set(write_set, (*field)->field_index))
 
976
    if (!write_set->test((*field)->field_index))
973
977
    {
974
978
      /*
975
979
       * If the field doesn't have any default value