~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-20 19:07:14 UTC
  • mfrom: (1223.1.5 push)
  • Revision ID: brian@gaz-20091120190714-dhr3lgqxrt7dq1fc
Collected Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
751
751
  @retval
752
752
   1  error
753
753
 
754
 
   @todo refactor to remove goto, and absorb check_engine() logic into createTable()
 
754
   @todo refactor to remove goto
755
755
*/
756
756
int plugin::StorageEngine::createTable(Session& session, const char *path,
757
757
                                       const char *db, const char *table_name,
758
 
                                       HA_CREATE_INFO& create_info,
759
758
                                       bool update_create_info,
760
759
                                       drizzled::message::Table& table_proto, bool proto_used)
761
760
{
780
779
    goto err;
781
780
 
782
781
  if (update_create_info)
783
 
    table.updateCreateInfo(&create_info, &table_proto);
 
782
    table.updateCreateInfo(&table_proto);
784
783
 
785
784
  /* Check for legal operations against the Engine using the proto (if used) */
786
785
  if (proto_used)
798
797
      goto err2;
799
798
    }
800
799
  }
801
 
  else // Lets see how good old create_info handles this
 
800
 
 
801
  if (! share.storage_engine->is_enabled())
802
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
 
    }
 
803
    error= HA_ERR_UNSUPPORTED;
 
804
    goto err2;
815
805
  }
816
806
 
817
807
 
823
813
 
824
814
    share.storage_engine->setTransactionReadWrite(session);
825
815
 
826
 
    error= share.storage_engine->doCreateTable(&session, table_name_arg, table,
827
 
                                               create_info, table_proto);
 
816
    error= share.storage_engine->doCreateTable(&session, 
 
817
                                               table_name_arg,
 
818
                                               table,
 
819
                                               table_proto);
828
820
  }
829
821
 
830
822
err2: