~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/foreign_key.h

  • Committer: Monty Taylor
  • Date: 2010-06-02 22:35:45 UTC
  • mto: This revision was merged to the branch mainline in revision 1586.
  • Revision ID: mordred@inaugust.com-20100602223545-q8ekf9b40a85nwuf
Rearragned unittests into a single exe because of how we need to link it
(thanks lifeless)
Link with server symbols without needing to build a library.
Added an additional atomics test which tests whatever version of the atomics
lib the running platform would actually use.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
#include "drizzled/key_part_spec.h"
27
27
#include "drizzled/sql_list.h"
28
28
#include "drizzled/cursor.h" /* for default_key_create_info */
29
 
#include "drizzled/message/table.pb.h"
30
29
 
31
30
namespace drizzled
32
31
{
36
35
 
37
36
namespace memory { class Root; }
38
37
 
39
 
void add_foreign_key_to_table_message(
40
 
    message::Table *table_message,
41
 
    const char* fkey_name,
42
 
    List<Key_part_spec> &cols,
43
 
    Table_ident *table,
44
 
    List<Key_part_spec> &ref_cols,
45
 
    message::Table::ForeignKeyConstraint::ForeignKeyOption delete_opt_arg,
46
 
    message::Table::ForeignKeyConstraint::ForeignKeyOption update_opt_arg,
47
 
    message::Table::ForeignKeyConstraint::ForeignKeyMatchOption match_opt_arg);
48
 
 
49
 
 
50
38
class Foreign_key: public Key 
51
39
{
52
40
public:
 
41
  enum fk_match_opt 
 
42
  {
 
43
    FK_MATCH_UNDEF, 
 
44
    FK_MATCH_FULL, 
 
45
    FK_MATCH_PARTIAL, 
 
46
    FK_MATCH_SIMPLE
 
47
  };
 
48
  enum fk_option 
 
49
  {
 
50
    FK_OPTION_UNDEF, 
 
51
    FK_OPTION_RESTRICT, 
 
52
    FK_OPTION_CASCADE, 
 
53
    FK_OPTION_SET_NULL, 
 
54
    FK_OPTION_NO_ACTION, 
 
55
    FK_OPTION_DEFAULT
 
56
  };
 
57
 
53
58
  Table_ident *ref_table;
54
59
  List<Key_part_spec> ref_columns;
55
 
 
56
 
  message::Table::ForeignKeyConstraint::ForeignKeyOption delete_opt;
57
 
  message::Table::ForeignKeyConstraint::ForeignKeyOption update_opt;
58
 
  message::Table::ForeignKeyConstraint::ForeignKeyMatchOption match_opt;
59
 
 
 
60
  uint32_t delete_opt, update_opt, match_opt;
60
61
  Foreign_key(const LEX_STRING &name_arg,
61
62
              List<Key_part_spec> &cols,
62
63
              Table_ident *table,
63
64
              List<Key_part_spec> &ref_cols,
64
 
              message::Table::ForeignKeyConstraint::ForeignKeyOption delete_opt_arg,
65
 
              message::Table::ForeignKeyConstraint::ForeignKeyOption update_opt_arg,
66
 
              message::Table::ForeignKeyConstraint::ForeignKeyMatchOption match_opt_arg) :
 
65
              uint32_t delete_opt_arg,
 
66
              uint32_t update_opt_arg,
 
67
              uint32_t match_opt_arg) :
67
68
    Key(FOREIGN_KEY, name_arg, &default_key_create_info, 0, cols), ref_table(table),
68
69
    ref_columns(ref_cols),
69
70
    delete_opt(delete_opt_arg),