~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • 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:
878
878
      fk_key_count++;
879
879
      if (((Foreign_key *)key)->validate(alter_info->create_list))
880
880
        return true;
 
881
 
881
882
      Foreign_key *fk_key= (Foreign_key*) key;
 
883
 
 
884
      add_foreign_key_to_table_message(&create_proto,
 
885
                                       fk_key->name.str,
 
886
                                       fk_key->columns,
 
887
                                       fk_key->ref_table,
 
888
                                       fk_key->ref_columns,
 
889
                                       fk_key->delete_opt,
 
890
                                       fk_key->update_opt,
 
891
                                       fk_key->match_opt);
 
892
 
882
893
      if (fk_key->ref_columns.elements &&
883
894
          fk_key->ref_columns.elements != fk_key->columns.elements)
884
895
      {