~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_lex.h

  • Committer: Jay Pipes
  • Date: 2009-09-15 21:01:42 UTC
  • mto: (1126.2.5 merge)
  • mto: This revision was merged to the branch mainline in revision 1128.
  • Revision ID: jpipes@serialcoder-20090915210142-x8mwiqn1q0vzjspp
Moves Alter_info out into its own header and source file, cleans up some related include mess in sql_lex.h, and renames Alter_info to AlterInfo.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
#include "drizzled/function/math/real.h"
35
35
#include "drizzled/alter_drop.h"
36
36
#include "drizzled/alter_column.h"
 
37
#include "drizzled/alter_info.h"
37
38
#include "drizzled/key.h"
38
39
#include "drizzled/foreign_key.h"
39
40
#include "drizzled/item/param.h"
102
103
  ROLLUP_TYPE
103
104
};
104
105
 
105
 
enum tablespace_op_type
106
 
{
107
 
  NO_TABLESPACE_OP,
108
 
  DISCARD_TABLESPACE,
109
 
  IMPORT_TABLESPACE
110
 
};
111
 
 
112
106
/*
113
107
  The state of the lex parsing for selects
114
108
 
640
634
    first_select()->next_select()->linkage == UNION_TYPE;
641
635
}
642
636
 
643
 
enum enum_alter_info_flags
644
 
{
645
 
  ALTER_ADD_COLUMN= 0,
646
 
  ALTER_DROP_COLUMN,
647
 
  ALTER_CHANGE_COLUMN,
648
 
  ALTER_COLUMN_STORAGE,
649
 
  ALTER_COLUMN_FORMAT,
650
 
  ALTER_COLUMN_ORDER,
651
 
  ALTER_ADD_INDEX,
652
 
  ALTER_DROP_INDEX,
653
 
  ALTER_RENAME,
654
 
  ALTER_ORDER,
655
 
  ALTER_OPTIONS,
656
 
  ALTER_COLUMN_DEFAULT,
657
 
  ALTER_KEYS_ONOFF,
658
 
  ALTER_STORAGE,
659
 
  ALTER_ROW_FORMAT,
660
 
  ALTER_CONVERT,
661
 
  ALTER_FORCE,
662
 
  ALTER_RECREATE,
663
 
  ALTER_TABLE_REORG,
664
 
  ALTER_FOREIGN_KEY
665
 
};
666
 
 
667
 
/**
668
 
  @brief Parsing data for CREATE or ALTER Table.
669
 
 
670
 
  This structure contains a list of columns or indexes to be created,
671
 
  altered or dropped.
672
 
*/
673
 
 
674
 
class Alter_info
675
 
{
676
 
public:
677
 
  List<Alter_drop> drop_list;
678
 
  List<Alter_column> alter_list;
679
 
  List<Key> key_list;
680
 
  List<CreateField> create_list;
681
 
  std::bitset<32> flags;
682
 
  enum enum_enable_or_disable keys_onoff;
683
 
  enum tablespace_op_type tablespace_op;
684
 
  uint32_t no_parts;
685
 
  enum ha_build_method build_method;
686
 
  CreateField *datetime_field;
687
 
  bool error_if_not_empty;
688
 
 
689
 
  Alter_info() :
690
 
    flags(),
691
 
    keys_onoff(LEAVE_AS_IS),
692
 
    tablespace_op(NO_TABLESPACE_OP),
693
 
    no_parts(0),
694
 
    build_method(HA_BUILD_DEFAULT),
695
 
    datetime_field(NULL),
696
 
    error_if_not_empty(false)
697
 
  {}
698
 
 
699
 
  void reset()
700
 
  {
701
 
    drop_list.empty();
702
 
    alter_list.empty();
703
 
    key_list.empty();
704
 
    create_list.empty();
705
 
    flags.reset();
706
 
    keys_onoff= LEAVE_AS_IS;
707
 
    tablespace_op= NO_TABLESPACE_OP;
708
 
    no_parts= 0;
709
 
    build_method= HA_BUILD_DEFAULT;
710
 
    datetime_field= 0;
711
 
    error_if_not_empty= false;
712
 
  }
713
 
  Alter_info(const Alter_info &rhs, MEM_ROOT *mem_root);
714
 
private:
715
 
  Alter_info &operator=(const Alter_info &rhs); // not implemented
716
 
  Alter_info(const Alter_info &rhs);            // not implemented
717
 
};
718
 
 
719
637
enum xa_option_words
720
638
{
721
639
  XA_NONE
960
878
  bool tx_release;
961
879
  /* Was the IGNORE symbol found in statement */
962
880
  bool ignore;
963
 
  Alter_info alter_info;
 
881
  AlterInfo alter_info;
964
882
 
965
883
  /*
966
884
    Pointers to part of LOAD DATA statement that should be rewritten