~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/statement/create_table.cc

  • Committer: Brian Aker
  • Date: 2010-12-16 18:52:06 UTC
  • mfrom: (1999.2.2 compare)
  • Revision ID: brian@tangent.org-20101216185206-nqx8ys9jj863xqie
Merge in identifier work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
                                       create_table->getTableName(),
87
87
                                       create_table_message.type());
88
88
 
89
 
  if (create_table_precheck(new_table_identifier))
 
89
  if (not check(new_table_identifier))
90
90
  {
91
91
    /* put tables back for PS rexecuting */
92
92
    session->lex->link_first_table_back(create_table, link_to_local);
230
230
  return res;
231
231
}
232
232
 
 
233
bool statement::CreateTable::check(const TableIdentifier &identifier)
 
234
{
 
235
  // Check table name for validity
 
236
  if (not identifier.isValid())
 
237
    return false;
 
238
 
 
239
  // See if any storage engine objects to the name of the file
 
240
  if (not plugin::StorageEngine::canCreateTable(identifier))
 
241
  {
 
242
    my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", identifier.getSchemaName().c_str());
 
243
 
 
244
    return false;
 
245
  }
 
246
 
 
247
  // Make sure the schema exists, we will do this again during the actual
 
248
  // create for the table.
 
249
  if (not plugin::StorageEngine::doesSchemaExist(identifier))
 
250
  {
 
251
    my_error(ER_BAD_DB_ERROR, MYF(0), identifier.getSchemaName().c_str());
 
252
 
 
253
    return false;
 
254
  }
 
255
 
 
256
  return true;
 
257
}
 
258
 
233
259
bool statement::CreateTable::validateCreateTableOption()
234
260
{
235
261
  bool rc= true;