~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.h

  • Committer: Monty Taylor
  • Date: 2009-05-08 19:27:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1009.
  • Revision ID: mordred@inaugust.com-20090508192721-glbsg850k7wqp1rd
Further reversion of P.

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
 
 
42
40
#define HA_MAX_ALTER_FLAGS 40
43
 
typedef std::bitset<HA_MAX_ALTER_FLAGS> HA_ALTER_FLAGS;
 
41
typedef Bitmap<HA_MAX_ALTER_FLAGS> HA_ALTER_FLAGS;
44
42
 
45
43
 
46
44
typedef bool (*qc_engine_callback)(Session *session, char *table_key,
726
724
   check_if_incompatible_data(HA_CREATE_INFO *, uint32_t)
727
725
 { return COMPATIBLE_DATA_NO; }
728
726
 
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
 
 
750
727
 /* On-line ALTER Table interface */
751
728
 
752
729
 /**
778
755
   if (this->check_if_incompatible_data(create_info, table_changes)
779
756
       == COMPATIBLE_DATA_NO)
780
757
     return(HA_ALTER_NOT_SUPPORTED);
781
 
   else if (this->check_stored_vcol_flag(alter_flags))
 
758
   else if ((*alter_flags & HA_ALTER_STORED_VCOL).is_set())
782
759
     return(HA_ALTER_NOT_SUPPORTED);
783
760
   else
784
761
     return(HA_ALTER_SUPPORTED_WAIT_LOCK);