~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/foreign_key.h

Collection of patches/bug fixes from new-cleanup tree (none of the
Table/other fixes are included).

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
public:
35
35
  enum fk_match_opt 
36
36
  {
37
 
    FK_MATCH_UNDEF
38
 
  , FK_MATCH_FULL
39
 
  , FK_MATCH_PARTIAL
40
 
  , FK_MATCH_SIMPLE
 
37
    FK_MATCH_UNDEF, 
 
38
    FK_MATCH_FULL, 
 
39
    FK_MATCH_PARTIAL, 
 
40
    FK_MATCH_SIMPLE
41
41
  };
42
42
  enum fk_option 
43
43
  {
44
 
    FK_OPTION_UNDEF
45
 
  , FK_OPTION_RESTRICT
46
 
  , FK_OPTION_CASCADE
47
 
  , FK_OPTION_SET_NULL
48
 
  , FK_OPTION_NO_ACTION
49
 
  , FK_OPTION_DEFAULT
 
44
    FK_OPTION_UNDEF, 
 
45
    FK_OPTION_RESTRICT, 
 
46
    FK_OPTION_CASCADE, 
 
47
    FK_OPTION_SET_NULL, 
 
48
    FK_OPTION_NO_ACTION, 
 
49
    FK_OPTION_DEFAULT
50
50
  };
51
51
 
52
52
  Table_ident *ref_table;
53
53
  List<Key_part_spec> ref_columns;
54
54
  uint32_t delete_opt, update_opt, match_opt;
55
 
  Foreign_key(const LEX_STRING &name_arg
56
 
            , List<Key_part_spec> &cols
57
 
            , Table_ident *table
58
 
            , List<Key_part_spec> &ref_cols
59
 
            , uint32_t delete_opt_arg
60
 
            , uint32_t update_opt_arg
61
 
            , uint32_t match_opt_arg)
62
 
  :Key(FOREIGN_KEY
63
 
     , name_arg
64
 
     , &default_key_create_info
65
 
     , 0
66
 
     , cols)
67
 
   , ref_table(table)
68
 
   , ref_columns(ref_cols)
69
 
   , delete_opt(delete_opt_arg)
70
 
   , update_opt(update_opt_arg)
71
 
   , match_opt(match_opt_arg)
72
 
  {}
 
55
  Foreign_key(const LEX_STRING &name_arg,
 
56
              List<Key_part_spec> &cols,
 
57
              Table_ident *table,
 
58
              List<Key_part_spec> &ref_cols,
 
59
              uint32_t delete_opt_arg,
 
60
              uint32_t update_opt_arg,
 
61
              uint32_t match_opt_arg) :
 
62
    Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols), ref_table(table),
 
63
    ref_columns(ref_cols),
 
64
    delete_opt(delete_opt_arg),
 
65
    update_opt(update_opt_arg),
 
66
    match_opt(match_opt_arg)
 
67
  { }
 
68
 
 
69
 
73
70
  /**
74
71
   * Constructs an (almost) deep copy of this foreign key. Only those
75
72
   * elements that are known to never change are not copied.
77
74
   * in Session.
78
75
   */
79
76
  Foreign_key(const Foreign_key &rhs, MEM_ROOT *mem_root);
 
77
 
 
78
 
80
79
  /**
81
80
   * Used to make a clone of this object for ALTER/CREATE TABLE
82
81
   * 
86
85
  {
87
86
    return new (mem_root) Foreign_key(*this, mem_root);
88
87
  }
 
88
 
 
89
 
89
90
  /* Used to validate foreign key options */
90
91
  bool validate(List<CreateField> &table_fields);
91
92
};