~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-23 10:47:03 UTC
  • mto: This revision was merged to the branch mainline in revision 2348.
  • Revision ID: olafvdspek@gmail.com-20110623104703-hw93svu0vfgcqt9p
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
197
197
        {
198
198
          if (message) // If we have no definition, we don't know if the table should have been replicated
199
199
          {
200
 
            TransactionServices &transaction_services= TransactionServices::singleton();
201
 
            transaction_services.dropTable(*session, identifier, *message, if_exists);
 
200
            TransactionServices::dropTable(*session, identifier, *message, if_exists);
202
201
          }
203
202
        }
204
203
        else
1368
1367
 
1369
1368
  if (table_proto.type() == message::Table::STANDARD && not internal_tmp_table)
1370
1369
  {
1371
 
    TransactionServices &transaction_services= TransactionServices::singleton();
1372
 
    transaction_services.createTable(*session, table_proto);
 
1370
    TransactionServices::createTable(*session, table_proto);
1373
1371
  }
1374
1372
 
1375
1373
  return false;
1714
1712
  List<Item> field_list;
1715
1713
  Item *item;
1716
1714
  int result_code= 0;
1717
 
  TransactionServices &transaction_services= TransactionServices::singleton();
1718
1715
  const charset_info_st * const cs= system_charset_info;
1719
1716
 
1720
1717
  if (! session->endActiveTransaction())
1789
1786
      length= snprintf(buff, sizeof(buff), ER(ER_OPEN_AS_READONLY),
1790
1787
                       table_name.c_str());
1791
1788
      session->getClient()->store(buff, length);
1792
 
      transaction_services.autocommitOrRollback(*session, false);
 
1789
      TransactionServices::autocommitOrRollback(*session, false);
1793
1790
      session->endTransaction(COMMIT);
1794
1791
      session->close_thread_tables();
1795
1792
      session->lex().reset_query_tables_list(false);
1913
1910
        }
1914
1911
      }
1915
1912
    }
1916
 
    transaction_services.autocommitOrRollback(*session, false);
 
1913
    TransactionServices::autocommitOrRollback(*session, false);
1917
1914
    session->endTransaction(COMMIT);
1918
1915
    session->close_thread_tables();
1919
1916
    table->table=0;                             // For query cache
1925
1922
  return false;
1926
1923
 
1927
1924
err:
1928
 
  transaction_services.autocommitOrRollback(*session, true);
 
1925
  TransactionServices::autocommitOrRollback(*session, true);
1929
1926
  session->endTransaction(ROLLBACK);
1930
1927
  session->close_thread_tables();                       // Shouldn't be needed
1931
1928
  if (table)
2016
2013
 
2017
2014
  if (success && not destination_identifier.isTmp())
2018
2015
  {
2019
 
    TransactionServices &transaction_services= TransactionServices::singleton();
2020
 
    transaction_services.createTable(session, new_table_message);
 
2016
    TransactionServices::createTable(session, new_table_message);
2021
2017
  }
2022
2018
 
2023
2019
  return success;