~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/message/statement_transform.cc

  • Committer: Brian Aker
  • Date: 2010-10-27 23:24:30 UTC
  • mfrom: (1861.4.9 trunk-drizzle)
  • Revision ID: brian@tangent.org-20101027232430-e9ces9kmhvknr86c
Merge in additions to IS for FK

Show diffs side-by-side

added added

removed removed

Lines of Context:
1196
1196
{
1197
1197
  switch (opt)
1198
1198
  {
1199
 
  case Table::ForeignKeyConstraint::OPTION_UNDEF:
1200
 
    break;
1201
1199
  case Table::ForeignKeyConstraint::OPTION_RESTRICT:
1202
1200
    destination.append("RESTRICT");
1203
1201
    break;
1207
1205
  case Table::ForeignKeyConstraint::OPTION_SET_NULL:
1208
1206
    destination.append("SET NULL");
1209
1207
    break;
 
1208
  case Table::ForeignKeyConstraint::OPTION_UNDEF:
1210
1209
  case Table::ForeignKeyConstraint::OPTION_NO_ACTION:
1211
1210
    destination.append("NO ACTION");
1212
1211
    break;
1213
 
  case Table::ForeignKeyConstraint::OPTION_DEFAULT:
 
1212
  case Table::ForeignKeyConstraint::OPTION_SET_DEFAULT:
1214
1213
    destination.append("SET DEFAULT");
1215
1214
    break;
1216
1215
  }
1263
1262
 
1264
1263
  destination.push_back(')');
1265
1264
 
1266
 
  if (fkey.update_option() != Table::ForeignKeyConstraint::OPTION_UNDEF)
 
1265
  if (fkey.has_update_option() and fkey.update_option() != Table::ForeignKeyConstraint::OPTION_UNDEF)
1267
1266
  {
1268
1267
    destination.append(" ON UPDATE ", 11);
1269
1268
    transformForeignKeyOptionToSql(fkey.update_option(), destination);
1270
1269
  }
1271
1270
 
1272
 
  if (fkey.delete_option() != Table::ForeignKeyConstraint::OPTION_UNDEF)
 
1271
  if (fkey.has_delete_option() and fkey.delete_option() != Table::ForeignKeyConstraint::OPTION_UNDEF)
1273
1272
  {
1274
1273
    destination.append(" ON DELETE ", 11);
1275
1274
    transformForeignKeyOptionToSql(fkey.delete_option(), destination);