~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Olaf van der Spek
  • Date: 2011-04-05 12:26:58 UTC
  • mto: (2278.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2272.
  • Revision ID: olafvdspek@gmail.com-20110405122658-xxrvmobwwwwf3oct
Refactor Open_tables_state

Show diffs side-by-side

added added

removed removed

Lines of Context:
1736
1736
  Close all temporary tables created by 'CREATE TEMPORARY TABLE' for thread
1737
1737
*/
1738
1738
 
1739
 
void Open_tables_state::close_temporary_tables()
 
1739
void Session::close_temporary_tables()
1740
1740
{
1741
1741
  Table *table;
1742
1742
  Table *tmp_next;
1756
1756
  unlink from session->temporary tables and close temporary table
1757
1757
*/
1758
1758
 
1759
 
void Open_tables_state::close_temporary_table(Table *table)
 
1759
void Session::close_temporary_table(Table *table)
1760
1760
{
1761
1761
  if (table->getPrev())
1762
1762
  {
1792
1792
  If this is needed, use close_temporary_table()
1793
1793
*/
1794
1794
 
1795
 
void Open_tables_state::nukeTable(Table *table)
 
1795
void Session::nukeTable(Table *table)
1796
1796
{
1797
1797
  plugin::StorageEngine& table_type= *table->getShare()->db_type();
1798
1798
  table->free_io_cache();
1980
1980
  might be an issue (lame engines).
1981
1981
*/
1982
1982
 
1983
 
bool Open_tables_state::rm_temporary_table(const identifier::Table &identifier, bool best_effort)
 
1983
bool Session::rm_temporary_table(const identifier::Table &identifier, bool best_effort)
1984
1984
{
1985
 
  if (plugin::StorageEngine::dropTable(*static_cast<Session *>(this), identifier))
 
1985
  if (plugin::StorageEngine::dropTable(*this, identifier))
1986
1986
                return false;
1987
1987
  if (not best_effort)
1988
1988
    errmsg_printf(error::WARN, _("Could not remove temporary table: '%s', error: %d"), identifier.getSQLPath().c_str(), errno);
1989
1989
  return true;
1990
1990
}
1991
1991
 
1992
 
bool Open_tables_state::rm_temporary_table(plugin::StorageEngine& base, const identifier::Table &identifier)
 
1992
bool Session::rm_temporary_table(plugin::StorageEngine& base, const identifier::Table &identifier)
1993
1993
{
1994
1994
  drizzled::error_t error;
1995
 
  if (plugin::StorageEngine::dropTable(*static_cast<Session *>(this), base, identifier, error))
 
1995
  if (plugin::StorageEngine::dropTable(*this, base, identifier, error))
1996
1996
                return false;
1997
1997
  errmsg_printf(error::WARN, _("Could not remove temporary table: '%s', error: %d"), identifier.getSQLPath().c_str(), error);
1998
1998
  return true;