~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/foreign_key.h

  • Committer: Monty Taylor
  • Date: 2011-03-06 18:40:09 UTC
  • mto: (2221.2.1 build)
  • mto: This revision was merged to the branch mainline in revision 2222.
  • Revision ID: mordred@inaugust.com-20110306184009-y1dz5gdqxj7aur83
Honors PYTHON env variable for running pandora-plugin. It's important,
because some systems will need to let us know where python2 is now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
 
21
 
#pragma once
 
21
#ifndef DRIZZLED_FOREIGN_KEY_H
 
22
#define DRIZZLED_FOREIGN_KEY_H
22
23
 
23
24
#include <drizzled/memory/sql_alloc.h>
24
25
#include <drizzled/key.h>
27
28
#include <drizzled/cursor.h> /* for default_key_create_info */
28
29
#include <drizzled/message/table.pb.h>
29
30
 
30
 
namespace drizzled {
 
31
namespace drizzled
 
32
{
 
33
 
 
34
class Item;
 
35
class Table_ident;
 
36
 
 
37
namespace memory { class Root; }
31
38
 
32
39
void add_foreign_key_to_table_message(
33
40
    message::Table *table_message,
50
57
  message::Table::ForeignKeyConstraint::ForeignKeyOption update_opt;
51
58
  message::Table::ForeignKeyConstraint::ForeignKeyMatchOption match_opt;
52
59
 
53
 
  Foreign_key(const lex_string_t &name_arg,
 
60
  Foreign_key(const LEX_STRING &name_arg,
54
61
              List<Key_part_spec> &cols,
55
62
              Table_ident *table,
56
63
              List<Key_part_spec> &ref_cols,
73
80
   */
74
81
  Foreign_key(const Foreign_key &rhs, memory::Root *mem_root);
75
82
 
 
83
 
 
84
  /**
 
85
   * Used to make a clone of this object for ALTER/CREATE TABLE
 
86
   * 
 
87
   * @see comment for Key_part_spec::clone
 
88
   */
 
89
  virtual Key *clone(memory::Root *mem_root) const
 
90
  {
 
91
    return new (mem_root) Foreign_key(*this, mem_root);
 
92
  }
 
93
 
 
94
 
76
95
  /* Used to validate foreign key options */
77
96
  bool validate(List<CreateField> &table_fields);
78
97
};
79
98
 
80
99
} /* namespace drizzled */
81
100
 
 
101
#endif /* DRIZZLED_FOREIGN_KEY_H */