~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/generator/all_tables.h

  • Committer: Stewart Smith
  • Date: 2010-07-27 00:49:32 UTC
  • mto: (1720.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1721.
  • Revision ID: stewart@flamingspork.com-20100727004932-basq3vx9szmmbswm
fix storing and manipulating foreign keys in the proto around ALTER TABLE, CREATE TABLE and ALTER TABLE ADD/DROP FOREIGN KEY. We also (mostly) emulate the naming of innodb foreign keys in the upper layer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
class AllTables
30
30
{
31
31
  Session &session;
32
 
  message::table::shared_ptr table;
 
32
  message::Table table;
33
33
 
34
 
  TableIdentifier::vector table_names;
35
 
  TableIdentifier::vector::const_iterator table_iterator;
 
34
  TableIdentifiers table_names;
 
35
  TableIdentifiers::const_iterator table_iterator;
36
36
 
37
37
  drizzled::generator::Schema schema_generator;
38
38
  const drizzled::SchemaIdentifier *schema_ptr;
45
45
 
46
46
  void reset();
47
47
 
48
 
  operator const drizzled::message::table::shared_ptr()
 
48
  operator const drizzled::message::Table*()
49
49
  {
50
50
    do {
51
51
      while (table_iterator != table_names.end())
52
52
      {
 
53
        table.Clear();
53
54
        bool is_table_parsed= plugin::StorageEngine::getTableDefinition(session, *table_iterator, table);
54
55
        table_iterator++;
55
56
 
56
57
        if (is_table_parsed)
57
 
          return table;
 
58
          return &table;
58
59
      }
59
60
    } while ((schema_ptr= schema_generator) && table_setup());
60
61
 
61
 
    return message::table::shared_ptr();
 
62
    return NULL;
62
63
  }
63
64
 
64
65
  operator const drizzled::TableIdentifier*()