~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Brian Aker
  • Date: 2011-01-13 07:24:48 UTC
  • mfrom: (2068.7.8 session-fix)
  • Revision ID: brian@gir-3-20110113072448-c07so48hh6lopysr
Merge in fix around API (we should be able to move to seeing errors directly
from SE interface (which solves the wishlist issue, and convoluted issues
around issuing errors).

Show diffs side-by-side

added added

removed removed

Lines of Context:
2004
2004
                                 const TableIdentifier &src_table,
2005
2005
                                 bool is_engine_set)
2006
2006
{
2007
 
  int protoerr= EEXIST;
 
2007
  int protoerr;
2008
2008
  message::Table new_proto;
2009
2009
  message::table::shared_ptr src_proto;
2010
2010
 
2045
2045
 
2046
2046
  /*
2047
2047
    As mysql_truncate don't work on a new table at this stage of
2048
 
    creation, instead create the table directly (for both normal
2049
 
    and temporary tables).
 
2048
    creation, instead create the table directly (for both normal and temporary tables).
2050
2049
  */
2051
 
  int err= plugin::StorageEngine::createTable(session,
2052
 
                                              destination_identifier,
2053
 
                                              new_proto);
 
2050
  bool success= plugin::StorageEngine::createTable(session,
 
2051
                                                   destination_identifier,
 
2052
                                                   new_proto);
2054
2053
 
2055
 
  if (err == false && not destination_identifier.isTmp())
 
2054
  if (success && not destination_identifier.isTmp())
2056
2055
  {
2057
2056
    TransactionServices &transaction_services= TransactionServices::singleton();
2058
2057
    transaction_services.createTable(&session, new_proto);
2059
2058
  }
2060
2059
 
2061
 
  return err ? false : true;
 
2060
  return success;
2062
2061
}
2063
2062
 
2064
2063
/*
2077
2076
*/
2078
2077
 
2079
2078
bool create_like_table(Session* session,
2080
 
                             const TableIdentifier &destination_identifier,
2081
 
                             TableList* table, TableList* src_table,
2082
 
                             message::Table &create_table_proto,
2083
 
                             bool is_if_not_exists,
2084
 
                             bool is_engine_set)
 
2079
                       const TableIdentifier &destination_identifier,
 
2080
                       TableList* table, TableList* src_table,
 
2081
                       message::Table &create_table_proto,
 
2082
                       bool is_if_not_exists,
 
2083
                       bool is_engine_set)
2085
2084
{
2086
2085
  bool res= true;
2087
2086
  uint32_t not_used;