421
421
transaction_services.rollbackTransaction(*this, true);
424
for (UserVars::iterator iter= user_vars.begin();
425
iter != user_vars.end();
428
user_var_entry *entry= iter->second;
429
boost::checked_delete(entry);
424
BOOST_FOREACH(UserVars::reference iter, user_vars)
425
boost::checked_delete(iter.second);
431
426
user_vars.clear();
1799
1794
void Open_tables_state::nukeTable(Table *table)
1801
plugin::StorageEngine *table_type= table->getShare()->db_type();
1796
plugin::StorageEngine& table_type= *table->getShare()->db_type();
1803
1797
table->free_io_cache();
1804
1798
table->delete_table();
1806
identifier::Table identifier(table->getShare()->getSchemaName(), table->getShare()->getTableName(), table->getShare()->getPath());
1807
rm_temporary_table(table_type, identifier);
1799
rm_temporary_table(table_type, identifier::Table(table->getShare()->getSchemaName(), table->getShare()->getTableName(), table->getShare()->getPath()));
1809
1800
boost::checked_delete(table->getMutableShare());
1811
1801
boost::checked_delete(table);
1840
1830
if (not create_if_not_exists)
1843
user_var_entry *entry= NULL;
1844
entry= new (nothrow) user_var_entry(name.c_str(), query_id);
1833
user_var_entry *entry= new user_var_entry(name.c_str(), query_id);
1849
1835
std::pair<UserVars::iterator, bool> returnable= user_vars.insert(make_pair(name, entry));
1996
1982
bool Open_tables_state::rm_temporary_table(const identifier::Table &identifier, bool best_effort)
1998
if (not plugin::StorageEngine::dropTable(*static_cast<Session *>(this), identifier))
2000
if (not best_effort)
2003
identifier.getSQLPath(path);
2004
errmsg_printf(error::WARN, _("Could not remove temporary table: '%s', error: %d"),
2005
path.c_str(), errno);
1984
if (plugin::StorageEngine::dropTable(*static_cast<Session *>(this), identifier))
1986
if (not best_effort)
1987
errmsg_printf(error::WARN, _("Could not remove temporary table: '%s', error: %d"), identifier.getSQLPath().c_str(), errno);
2014
bool Open_tables_state::rm_temporary_table(plugin::StorageEngine *base, const identifier::Table &identifier)
1991
bool Open_tables_state::rm_temporary_table(plugin::StorageEngine& base, const identifier::Table &identifier)
2016
1993
drizzled::error_t error;
2019
if (not plugin::StorageEngine::dropTable(*static_cast<Session *>(this), *base, identifier, error))
2022
identifier.getSQLPath(path);
2023
errmsg_printf(error::WARN, _("Could not remove temporary table: '%s', error: %d"),
2024
path.c_str(), error);
2033
@note this will be removed, I am looking through Hudson to see if it is finding
2034
any tables that are missed during cleanup.
2036
void Open_tables_state::dumpTemporaryTableNames(const char *foo)
2040
if (not temporary_tables)
2043
cerr << "Begin Run: " << foo << "\n";
2044
for (table= temporary_tables; table; table= table->getNext())
2046
bool have_proto= false;
2048
message::Table *proto= table->getShare()->getTableMessage();
2049
if (table->getShare()->getTableMessage())
2052
const char *answer= have_proto ? "true" : "false";
2056
cerr << "\tTable Name " << table->getShare()->getSchemaName() << "." << table->getShare()->getTableName() << " : " << answer << "\n";
2057
cerr << "\t\t Proto " << proto->schema() << " " << proto->name() << "\n";
2061
cerr << "\tTabl;e Name " << table->getShare()->getSchemaName() << "." << table->getShare()->getTableName() << " : " << answer << "\n";
1994
if (plugin::StorageEngine::dropTable(*static_cast<Session *>(this), base, identifier, error))
1996
errmsg_printf(error::WARN, _("Could not remove temporary table: '%s', error: %d"), identifier.getSQLPath().c_str(), error);
2066
2000
table::Singular& Session::getInstanceTable()