~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_table.cc

First pass on cleanup of Stewart's patch, plus re-engineer to make it work a
bit more with the current system. Engines approve key/pair.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
    create_info.db_type= session->getDefaultStorageEngine();
62
62
  }
63
63
 
 
64
  if (not validateCreateTableOption())
 
65
  {
 
66
    return true;
 
67
  }
 
68
 
64
69
  /* 
65
70
    Now we set the name in our Table proto so that it will match 
66
71
    create_info.db_type.
240
245
  return res;
241
246
}
242
247
 
 
248
bool statement::CreateTable::validateCreateTableOption()
 
249
{
 
250
  bool rc= true;
 
251
  size_t num_engine_options= create_table_message.engine().options_size();
 
252
 
 
253
  assert(create_info.db_type);
 
254
 
 
255
  for (size_t y= 0; y < num_engine_options; ++y)
 
256
  {
 
257
    bool valid= create_info.db_type->validateCreateTableOption(create_table_message.engine().options(y).name(),
 
258
                                                               create_table_message.engine().options(y).state());
 
259
 
 
260
    if (not valid)
 
261
    {
 
262
      my_error(ER_UNKNOWN_ENGINE_OPTION, MYF(0),
 
263
               create_table_message.engine().options(y).name().c_str(),
 
264
               create_table_message.engine().options(y).state().c_str());
 
265
 
 
266
      rc= false;
 
267
    }
 
268
  }
 
269
 
 
270
  return rc;
 
271
}
 
272
 
243
273
} /* namespace drizzled */
244
274