~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler.h

  • Committer: Brian Aker
  • Date: 2009-05-06 05:44:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1007.
  • Revision ID: brian@gaz-20090506054432-0omziuplq7fa2f4n
Next bit of ALTER TABLE wackiness.

Show diffs side-by-side

added added

removed removed

Lines of Context:
593
593
  */
594
594
  virtual const char **bas_ext() const =0;
595
595
 
596
 
  virtual int get_default_no_partitions(HA_CREATE_INFO *) { return 1;}
597
 
  virtual bool get_no_parts(const char *, uint32_t *no_parts)
598
 
  {
599
 
    *no_parts= 0;
600
 
    return 0;
601
 
  }
602
 
 
603
596
  virtual uint32_t index_flags(uint32_t idx, uint32_t part, bool all_parts) const =0;
604
597
 
605
598
  virtual int add_index(Table *, KEY *, uint32_t)
659
652
                                     THR_LOCK_DATA **to,
660
653
                                     enum thr_lock_type lock_type)=0;
661
654
 
662
 
  /** Type of table for caching query */
663
 
  virtual uint8_t table_cache_type() { return HA_CACHE_TBL_NONTRANSACT; }
664
 
 
665
 
 
666
655
 /*
667
656
   @retval true   Primary key (if there is one) is clustered
668
657
                  key covering all fields
712
701
 virtual Item *idx_cond_push(uint32_t, Item *idx_cond)
713
702
 { return idx_cond; }
714
703
 
715
 
 /*
716
 
    Part of old fast alter table, to be depricated
717
 
  */
718
 
 virtual bool
719
 
   check_if_incompatible_data(HA_CREATE_INFO *, uint32_t)
720
 
 { return COMPATIBLE_DATA_NO; }
721
 
 
722
 
 /* On-line ALTER Table interface */
723
 
 
724
 
 /**
725
 
    Check if a storage engine supports a particular alter table on-line
726
 
 
727
 
    @param    altered_table     A temporary table show what table is to
728
 
                                change to
729
 
    @param    create_info       Information from the parsing phase about new
730
 
                                table properties.
731
 
    @param    alter_flags       Bitmask that shows what will be changed
732
 
    @param    table_changes     Shows if table layout has changed (for
733
 
                                backwards compatibility with
734
 
                                check_if_incompatible_data
735
 
 
736
 
    @retval   HA_ALTER_ERROR                Unexpected error
737
 
    @retval   HA_ALTER_SUPPORTED_WAIT_LOCK  Supported, but requires DDL lock
738
 
    @retval   HA_ALTER_SUPPORTED_NO_LOCK    Supported
739
 
    @retval   HA_ALTER_NOT_SUPPORTED        Not supported
740
 
 
741
 
    @note
742
 
      The default implementation is implemented to support fast
743
 
      alter table (storage engines that support some changes by
744
 
      just changing the frm file) without any change in the handler
745
 
      implementation.
746
 
 */
747
 
 virtual int check_if_supported_alter(Table *, HA_CREATE_INFO *create_info,
748
 
                                      HA_ALTER_FLAGS * , uint32_t table_changes)
749
 
 {
750
 
   if (this->check_if_incompatible_data(create_info, table_changes)
751
 
       == COMPATIBLE_DATA_NO)
752
 
     return(HA_ALTER_NOT_SUPPORTED);
753
 
   else
754
 
     return(HA_ALTER_SUPPORTED_WAIT_LOCK);
755
 
 }
756
 
 /**
757
 
   Tell storage engine to prepare for the on-line alter table (pre-alter)
758
 
 
759
 
   @param     session               The thread handle
760
 
   @param     altered_table     A temporary table show what table is to
761
 
                                change to
762
 
   @param     alter_info        Storage place for data used during phase1
763
 
                                and phase2
764
 
   @param     alter_flags       Bitmask that shows what will be changed
765
 
 
766
 
   @retval   0      OK
767
 
   @retval   error  error code passed from storage engine
768
 
 */
769
 
 virtual int alter_table_phase1(Session *, Table *, HA_CREATE_INFO *, HA_ALTER_INFO *,
770
 
                                HA_ALTER_FLAGS *)
771
 
 {
772
 
   return HA_ERR_UNSUPPORTED;
773
 
 }
774
 
 /**
775
 
    Tell storage engine to perform the on-line alter table (alter)
776
 
 
777
 
    @param    session               The thread handle
778
 
    @param    altered_table     A temporary table show what table is to
779
 
                                change to
780
 
    @param    alter_info        Storage place for data used during phase1
781
 
                                and phase2
782
 
    @param    alter_flags       Bitmask that shows what will be changed
783
 
 
784
 
    @retval  0      OK
785
 
    @retval  error  error code passed from storage engine
786
 
 
787
 
    @note
788
 
      If check_if_supported_alter returns HA_ALTER_SUPPORTED_WAIT_LOCK
789
 
      this call is to be wrapped with a DDL lock. This is currently NOT
790
 
      supported.
791
 
 */
792
 
 virtual int alter_table_phase2(Session *, Table *, HA_CREATE_INFO *, HA_ALTER_INFO *,
793
 
                                HA_ALTER_FLAGS *)
794
 
 {
795
 
   return HA_ERR_UNSUPPORTED;
796
 
 }
797
 
 /**
798
 
    Tell storage engine that changed frm file is now on disk and table
799
 
    has been re-opened (post-alter)
800
 
 
801
 
    @param    session               The thread handle
802
 
    @param    table             The altered table, re-opened
803
 
 */
804
 
 virtual int alter_table_phase3(Session *, Table *)
805
 
 {
806
 
   return HA_ERR_UNSUPPORTED;
807
 
 }
808
 
 
809
704
  /**
810
705
    Lock table.
811
706