#include <open_tables_state.h>
Public Member Functions | |
Table * | getTemporaryTables () |
void | mark_temp_tables_as_free_for_reuse () |
void | close_temporary_tables () |
void | close_temporary_table (Table *) |
void | nukeTable (Table *) |
void | close_open_tables () |
bool | free_cached_table () |
Table * | find_temporary_table (const identifier::Table &identifier) |
void | dumpTemporaryTableNames (const char *id) |
int | drop_temporary_table (const identifier::Table &) |
bool | rm_temporary_table (plugin::StorageEngine &, const identifier::Table &) |
bool | rm_temporary_table (const identifier::Table &identifier, bool best_effort=false) |
Table * | getDerivedTables () |
void | setDerivedTables (Table *arg) |
void | clearDerivedTables () |
Open_tables_state (Session &, uint64_t version_arg) | |
void | doGetTableNames (CachedDirectory &, const identifier::Schema &, std::set< std::string > &) |
void | doGetTableNames (const identifier::Schema &, std::set< std::string > &) |
void | doGetTableIdentifiers (CachedDirectory &, const identifier::Schema &, identifier::table::vector &) |
void | doGetTableIdentifiers (const identifier::Schema &, identifier::table::vector &) |
int | doGetTableDefinition (const drizzled::identifier::Table &, message::Table &) |
bool | doDoesTableExist (const drizzled::identifier::Table &) |
Public Attributes | |
Table * | open_tables_ |
Table * | temporary_tables |
DrizzleLock * | lock |
DrizzleLock * | extra_lock |
uint64_t | version |
uint32_t | current_tablenr |
Private Attributes | |
Table * | derived_tables |
Session & | session_ |
Class that holds information about tables which were opened and locked by the thread.
Definition at line 34 of file open_tables_state.h.
void drizzled::Open_tables_state::close_open_tables | ( | ) |
Auxiliary function to close all tables in the open_tables list.
session | Thread context. |
Definition at line 309 of file sql_base.cc.
References drizzled::locking::broadcast_refresh().
Referenced by drizzled::Session::close_thread_tables().
int drizzled::Open_tables_state::drop_temporary_table | ( | const 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 564 of file sql_base.cc.
bool drizzled::Open_tables_state::free_cached_table | ( | ) |
move one table to free list
Definition at line 270 of file sql_base.cc.
References drizzled::Table::cursor, drizzled::Table::db_stat, drizzled::Cursor::ha_reset(), and drizzled::Table::in_use.
void drizzled::Open_tables_state::mark_temp_tables_as_free_for_reuse | ( | ) |
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 1693 of file session.cc.
References drizzled::Session::getQueryId().
Referenced by drizzled::Session::close_thread_tables().
Table* drizzled::Open_tables_state::open_tables_ |
List of regular tables in use by this thread. Contains temporary and base tables that were opened with
Definition at line 41 of file open_tables_state.h.
Referenced by drizzled::Session::close_thread_tables().
Table* drizzled::Open_tables_state::temporary_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 50 of file open_tables_state.h.