~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.cc

  • Committer: Brian Aker
  • Date: 2009-11-18 06:24:48 UTC
  • mfrom: (1220.1.15 staging)
  • Revision ID: brian@gaz-20091118062448-o36lo3yv81sc6u9z
Merge Brian + Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
750
750
   0  ok
751
751
  @retval
752
752
   1  error
 
753
 
 
754
   @todo refactor to remove goto, and absorb check_engine() logic into createTable()
753
755
*/
754
756
int plugin::StorageEngine::createTable(Session& session, const char *path,
755
757
                                       const char *db, const char *table_name,
780
782
  if (update_create_info)
781
783
    table.updateCreateInfo(&create_info, &table_proto);
782
784
 
 
785
  /* Check for legal operations against the Engine using the proto (if used) */
 
786
  if (proto_used)
 
787
  {
 
788
    if (table_proto.type() == message::Table::TEMPORARY && 
 
789
        share.storage_engine->check_flag(HTON_BIT_TEMPORARY_NOT_SUPPORTED) == true)
 
790
    {
 
791
      error= HA_ERR_UNSUPPORTED;
 
792
      goto err2;
 
793
    }
 
794
    else if (table_proto.type() != message::Table::TEMPORARY && 
 
795
             share.storage_engine->check_flag(HTON_BIT_TEMPORARY_ONLY) == true)
 
796
    {
 
797
      error= HA_ERR_UNSUPPORTED;
 
798
      goto err2;
 
799
    }
 
800
  }
 
801
  else // Lets see how good old create_info handles this
 
802
  {
 
803
    if (create_info.options & HA_LEX_CREATE_TMP_TABLE && 
 
804
        share.storage_engine->check_flag(HTON_BIT_TEMPORARY_NOT_SUPPORTED) == true)
 
805
    {
 
806
      error= HA_ERR_UNSUPPORTED;
 
807
      goto err2;
 
808
    }
 
809
    else if (create_info.options | HA_LEX_CREATE_TMP_TABLE &&
 
810
             share.storage_engine->check_flag(HTON_BIT_TEMPORARY_ONLY) == true)
 
811
    {
 
812
      error= HA_ERR_UNSUPPORTED;
 
813
      goto err2;
 
814
    }
 
815
  }
 
816
 
 
817
 
783
818
  {
784
819
    char name_buff[FN_REFLEN];
785
820
    const char *table_name_arg;
792
827
                                               create_info, table_proto);
793
828
  }
794
829
 
 
830
err2:
795
831
  table.closefrm(false);
 
832
 
796
833
  if (error)
797
834
  {
798
835
    char name_buff[FN_REFLEN];