~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/foreign_key.cc

  • Committer: Mark Atwood
  • Date: 2011-10-13 18:28:03 UTC
  • mfrom: (2433.1.5 rf1)
  • Revision ID: me@mark.atwood.name-20111013182803-pbmb3r5emfxfrbvy
mergeĀ lp:~olafvdspek/drizzle/refactor2

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
  pfkey->set_match(match_opt_arg);
60
60
  pfkey->set_update_option(update_opt_arg);
61
61
  pfkey->set_delete_option(delete_opt_arg);
62
 
 
63
62
  pfkey->set_references_table_name(table->table.data());
64
63
 
65
 
  Key_part_spec *keypart;
66
64
  List<Key_part_spec>::iterator col_it(cols.begin());
67
 
  while ((keypart= col_it++))
 
65
  while (Key_part_spec* keypart= col_it++)
68
66
  {
69
67
    pfkey->add_column_names(keypart->field_name.data());
70
68
  }
71
69
 
72
70
  List<Key_part_spec>::iterator ref_it(ref_cols.begin());
73
 
  while ((keypart= ref_it++))
 
71
  while (Key_part_spec* keypart= ref_it++)
74
72
  {
75
73
    pfkey->add_references_columns(keypart->field_name.data());
76
74
  }
187
185
*/
188
186
bool Foreign_key::validate(List<CreateField> &table_fields)
189
187
{
190
 
  CreateField  *sql_field;
191
 
  Key_part_spec *column;
192
188
  List<Key_part_spec>::iterator cols(columns.begin());
193
 
  List<CreateField>::iterator it(table_fields.begin());
194
 
  while ((column= cols++))
 
189
  while (Key_part_spec* column= cols++)
195
190
  {
196
 
    it= table_fields.begin();
197
 
    while ((sql_field= it++) &&
198
 
           my_strcasecmp(system_charset_info,
199
 
                         column->field_name.data(),
200
 
                         sql_field->field_name)) {}
 
191
    List<CreateField>::iterator it= table_fields.begin();
 
192
    CreateField* sql_field;
 
193
    while ((sql_field= it++) 
 
194
      && my_strcasecmp(system_charset_info, column->field_name.data(), sql_field->field_name))
 
195
    {
 
196
    }
201
197
    if (!sql_field)
202
198
    {
203
199
      my_error(ER_KEY_COLUMN_DOES_NOT_EXITS, MYF(0), column->field_name.data());