1796
1796
if (temporary_tables)
1797
1797
table->next->prev= NULL;
1799
close_temporary(table);
1803
Close and delete a temporary table
1803
Close and drop a temporary table
1806
1806
This dosn't unlink table from session->temporary
1807
1807
If this is needed, use close_temporary_table()
1810
void Session::close_temporary(Table *table)
1810
void Session::nukeTable(Table *table)
1812
1812
plugin::StorageEngine *table_type= table->s->db_type();
1814
1814
table->free_io_cache();
1815
1815
table->closefrm(false);
1817
rm_temporary_table(table_type, table->s->path.str);
1817
TableIdentifier identifier(table->s->getSchemaName(), table->s->table_name.str, table->s->path.str);
1818
rm_temporary_table(table_type, identifier);
1819
1820
table->s->free_table_share();
2034
2035
bool Session::rm_temporary_table(TableIdentifier &identifier)
2036
if (not plugin::StorageEngine::dropTable(*this, identifier))
2037
if (plugin::StorageEngine::dropTable(*this, identifier))
2038
2039
errmsg_printf(ERRMSG_LVL_WARN, _("Could not remove temporary table: '%s', error: %d"),
2039
identifier.getPath().c_str(), errno);
2040
identifier.getSQLPath().c_str(), errno);
2041
dumpTemporaryTableNames("rm_temporary_table()");
2047
bool Session::rm_temporary_table(plugin::StorageEngine *base, const char *path)
2049
bool Session::rm_temporary_table(plugin::StorageEngine *base, TableIdentifier &identifier)
2050
TableIdentifier dummy(path);
2054
if (delete_table_proto_file(path))
2057
if (base->doDropTable(*this, dummy))
2053
if (plugin::StorageEngine::dropTable(*this, *base, identifier))
2060
2055
errmsg_printf(ERRMSG_LVL_WARN, _("Could not remove temporary table: '%s', error: %d"),
2056
identifier.getSQLPath().c_str(), errno);
2057
dumpTemporaryTableNames("rm_temporary_table()");
2066
@note this will be removed, I am looking through Hudson to see if it is finding
2067
any tables that are missed during cleanup.
2069
void Session::dumpTemporaryTableNames(const char *foo)
2073
if (not temporary_tables)
2076
cerr << "Begin Run: " << foo << "\n";
2077
for (table= temporary_tables; table; table= table->next)
2079
bool have_proto= false;
2081
message::Table *proto= table->s->getTableProto();
2082
if (table->s->getTableProto())
2085
const char *answer= have_proto ? "true" : "false";
2089
cerr << "\tTable Name " << table->s->getSchemaName() << "." << table->s->table_name.str << " : " << answer << "\n";
2090
cerr << "\t\t Proto " << proto->schema() << " " << proto->name() << "\n";
2093
cerr << "\tTabl;e Name " << table->s->getSchemaName() << "." << table->s->table_name.str << " : " << answer << "\n";
2066
2097
bool Session::storeTableMessage(TableIdentifier &identifier, message::Table &table_message)