~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

Merge in Stewart's FK work

Show diffs side-by-side

added added

removed removed

Lines of Context:
888
888
                 ER(ER_KEY_REF_DO_NOT_MATCH_TABLE_REF));
889
889
        return(true);
890
890
      }
 
891
 
 
892
      message::Table::ForeignKeyConstraint *pfkey= create_proto.add_fk_constraint();
 
893
      if (fk_key->name.str)
 
894
        pfkey->set_name(fk_key->name.str);
 
895
 
 
896
      pfkey->set_match(fk_key->match_opt);
 
897
      pfkey->set_update_option(fk_key->update_opt);
 
898
      pfkey->set_delete_option(fk_key->delete_opt);
 
899
 
 
900
      pfkey->set_references_table_name(fk_key->ref_table->table.str);
 
901
 
 
902
      Key_part_spec *keypart;
 
903
      List_iterator<Key_part_spec> col_it(fk_key->columns);
 
904
      while ((keypart= col_it++))
 
905
      {
 
906
        pfkey->add_column_names(keypart->field_name.str);
 
907
      }
 
908
 
 
909
      List_iterator<Key_part_spec> ref_it(fk_key->ref_columns);
 
910
      while ((keypart= ref_it++))
 
911
      {
 
912
        pfkey->add_references_columns(keypart->field_name.str);
 
913
      }
 
914
 
891
915
      continue;
892
916
    }
893
917
    (*key_count)++;