~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_proto_write.cc

  • Committer: Brian Aker
  • Date: 2010-03-03 20:19:37 UTC
  • mto: This revision was merged to the branch mainline in revision 1321.
  • Revision ID: brian@gaz-20100303201937-acd0o36bz15y74ei
Second pass through remove proto write outside of SE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
545
545
                      keys, key_info))
546
546
    return 1;
547
547
 
548
 
  string new_path(identifier.getPath());
549
 
  string file_ext = ".dfe";
550
 
 
551
 
  new_path.append(file_ext);
552
 
 
553
 
  int err= 0;
554
 
 
555
 
  plugin::StorageEngine* engine= plugin::StorageEngine::findByName(*session,
556
 
                                                                   table_proto.engine().name());
557
 
  if (engine->check_flag(HTON_BIT_HAS_DATA_DICTIONARY) == false)
558
 
    err= drizzle_write_proto_file(new_path, table_proto);
559
 
 
560
 
  if (err != 0)
561
 
  {
562
 
    if (err == ENOENT)
563
 
      my_error(ER_BAD_DB_ERROR,MYF(0), identifier.getDBName());
564
 
    else
565
 
      my_error(ER_CANT_CREATE_TABLE, MYF(0), identifier.getTableName(), err);
566
 
 
567
 
    goto err_handler;
568
 
  }
569
 
 
570
548
  if (plugin::StorageEngine::createTable(*session,
571
549
                                         identifier,
572
550
                                         false, table_proto))
573
551
  {
574
 
    goto err_handler;
 
552
    return 1;
575
553
  }
576
554
 
577
555
  return 0;
578
556
 
579
 
err_handler:
580
 
  if (engine->check_flag(HTON_BIT_HAS_DATA_DICTIONARY) == false)
581
 
    plugin::StorageEngine::deleteDefinitionFromPath(identifier);
582
 
 
583
 
  return 1;
584
557
} /* rea_create_table */
585
558
 
586
559
} /* namespace drizzled */