~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.h

Merged Padraig.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
/* Bits to show what an alter table will do */
38
38
#include <drizzled/sql_bitmap.h>
39
39
 
 
40
#include<bitset>
 
41
 
40
42
#define HA_MAX_ALTER_FLAGS 40
41
 
typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_ALTER_FLAGS;
 
43
typedef std::bitset<HA_MAX_ALTER_FLAGS> HA_ALTER_FLAGS;
42
44
 
43
45
 
44
46
typedef bool (*qc_engine_callback)(Session *session, char *table_key,
724
726
   check_if_incompatible_data(HA_CREATE_INFO *, uint32_t)
725
727
 { return COMPATIBLE_DATA_NO; }
726
728
 
 
729
 /*
 
730
  * Check if the HA_ALTER_STORED_VCOL bit is set. If it is, then
 
731
  * we will clear all other bits and return true; otherwise 
 
732
  * clear all the bits in the the bitset and return false.
 
733
  *
 
734
  * @param    alter_flags    Bitmap that shows what will be changed
 
735
  */
 
736
 virtual bool check_stored_vcol_flag(HA_ALTER_FLAGS *alter_flags)
 
737
 {
 
738
   if (alter_flags->test(HA_ALTER_STORED_VCOL))
 
739
   {
 
740
     alter_flags->reset();
 
741
     alter_flags->set(HA_ALTER_STORED_VCOL);
 
742
   }
 
743
   else
 
744
   {
 
745
     alter_flags->reset();
 
746
   }
 
747
   return (alter_flags->any());
 
748
 }
 
749
 
727
750
 /* On-line ALTER Table interface */
728
751
 
729
752
 /**
755
778
   if (this->check_if_incompatible_data(create_info, table_changes)
756
779
       == COMPATIBLE_DATA_NO)
757
780
     return(HA_ALTER_NOT_SUPPORTED);
758
 
   else if ((*alter_flags & HA_ALTER_STORED_VCOL).is_set())
 
781
   else if (this->check_stored_vcol_flag(alter_flags))
759
782
     return(HA_ALTER_NOT_SUPPORTED);
760
783
   else
761
784
     return(HA_ALTER_SUPPORTED_WAIT_LOCK);