#include <open_tables_state.h>
Public Member Functions | |
Table * | getTemporaryTables () |
void | mark_temp_tables_as_free_for_reuse () |
void | close_temporary_table (Table *table) |
Table * | find_temporary_table (const identifier::Table &identifier) |
void | dumpTemporaryTableNames (const char *id) |
int | drop_temporary_table (const drizzled::identifier::Table &identifier) |
bool | rm_temporary_table (plugin::StorageEngine *base, const identifier::Table &identifier) |
bool | rm_temporary_table (const drizzled::identifier::Table &identifier, bool best_effort=false) |
Table * | open_temporary_table (const drizzled::identifier::Table &identifier, bool link_in_list=true) |
virtual query_id_t | getQueryId () const =0 |
Table * | getDerivedTables () |
void | setDerivedTables (Table *arg) |
void | clearDerivedTables () |
void | doGetTableNames (CachedDirectory &directory, const identifier::Schema &schema_identifier, std::set< std::string > &set_of_names) |
void | doGetTableNames (const identifier::Schema &schema_identifier, std::set< std::string > &set_of_names) |
void | doGetTableIdentifiers (CachedDirectory &directory, const identifier::Schema &schema_identifier, identifier::Table::vector &set_of_identifiers) |
void | doGetTableIdentifiers (const identifier::Schema &schema_identifier, identifier::Table::vector &set_of_identifiers) |
int | doGetTableDefinition (const drizzled::identifier::Table &identifier, message::Table &table_proto) |
bool | doDoesTableExist (const drizzled::identifier::Table &identifier) |
Open_tables_state (uint64_t version_arg) | |
Public Attributes | |
Table * | open_tables |
DrizzleLock * | lock |
DrizzleLock * | extra_lock |
uint64_t | version |
uint32_t | current_tablenr |
Protected Member Functions | |
void | close_temporary_tables () |
Private Member Functions | |
void | nukeTable (Table *table) |
Private Attributes | |
Table * | temporary_tables |
Table * | derived_tables |
Class that holds information about tables which were opened and locked by the thread. It is also used to save/restore this information in push_open_tables_state()/pop_open_tables_state().
Definition at line 37 of file open_tables_state.h.
int drizzled::Open_tables_state::drop_temporary_table | ( | const drizzled::identifier::Table & | identifier | ) |
Drop a temporary table.
Try to locate the table in the list of session->temporary_tables. If the table is found:
This function is used to drop user temporary tables, as well as internal tables created in CREATE TEMPORARY TABLE ... SELECT or ALTER Table. Even though part of the work done by this function is redundant when the table is internal, as long as we link both internal and user temporary tables into the same session->temporary_tables list, it's impossible to tell here whether we're dealing with an internal or a user temporary table.
0 | the table was found and dropped successfully. |
1 | the table was not found in the list of temporary tables of this thread |
-1 | the table is in use by a outer query |
Definition at line 639 of file sql_base.cc.
void drizzled::Open_tables_state::dumpTemporaryTableNames | ( | const char * | foo | ) |
Definition at line 2051 of file session.cc.
Mark all temporary tables which were used by the current statement or substatement as free for reuse, but only if the query_id can be cleared.
session | thread context |
Definition at line 1887 of file session.cc.
Referenced by drizzled::Session::close_thread_tables().
List of regular tables in use by this thread. Contains temporary and base tables that were opened with
Definition at line 44 of file open_tables_state.h.
Referenced by drizzled::Session::close_thread_tables().
List of temporary tables used by this thread. Contains user-level temporary tables, created with CREATE TEMPORARY TABLE, and internal temporary tables, created, e.g., to resolve a SELECT, or for an intermediate table used in ALTER. XXX Why are internal temporary tables added to this list?
Definition at line 54 of file open_tables_state.h.