~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2011-01-12 22:54:12 UTC
  • mto: This revision was merged to the branch mainline in revision 2079.
  • Revision ID: brian@tangent.org-20110112225412-u76lu18yz6furi4s
Fix interface for create table such that it issues error and returns state
like the rest of the API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2010
2010
                                 const TableIdentifier &src_table,
2011
2011
                                 bool is_engine_set)
2012
2012
{
2013
 
  int protoerr= EEXIST;
 
2013
  int protoerr;
2014
2014
  message::Table new_proto;
2015
2015
  message::table::shared_ptr src_proto;
2016
2016
 
2051
2051
 
2052
2052
  /*
2053
2053
    As mysql_truncate don't work on a new table at this stage of
2054
 
    creation, instead create the table directly (for both normal
2055
 
    and temporary tables).
 
2054
    creation, instead create the table directly (for both normal and temporary tables).
2056
2055
  */
2057
 
  int err= plugin::StorageEngine::createTable(session,
2058
 
                                              destination_identifier,
2059
 
                                              new_proto);
 
2056
  bool success= plugin::StorageEngine::createTable(session,
 
2057
                                                   destination_identifier,
 
2058
                                                   new_proto);
2060
2059
 
2061
 
  if (err == false && not destination_identifier.isTmp())
 
2060
  if (success && not destination_identifier.isTmp())
2062
2061
  {
2063
2062
    TransactionServices &transaction_services= TransactionServices::singleton();
2064
2063
    transaction_services.createTable(&session, new_proto);
2065
2064
  }
2066
2065
 
2067
 
  return err ? false : true;
 
2066
  return success;
2068
2067
}
2069
2068
 
2070
2069
/*
2083
2082
*/
2084
2083
 
2085
2084
bool create_like_table(Session* session,
2086
 
                             const TableIdentifier &destination_identifier,
2087
 
                             TableList* table, TableList* src_table,
2088
 
                             message::Table &create_table_proto,
2089
 
                             bool is_if_not_exists,
2090
 
                             bool is_engine_set)
 
2085
                       const TableIdentifier &destination_identifier,
 
2086
                       TableList* table, TableList* src_table,
 
2087
                       message::Table &create_table_proto,
 
2088
                       bool is_if_not_exists,
 
2089
                       bool is_engine_set)
2091
2090
{
2092
2091
  bool res= true;
2093
2092
  uint32_t not_used;