1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems, Inc.
4
* Copyright (C) 2008 Sun Microsystems
6
6
* This program is free software; you can redistribute it and/or modify
7
7
* it under the terms of the GNU General Public License as published by
51
43
or for an intermediate table used in ALTER.
52
44
XXX Why are internal temporary tables added to this list?
55
46
Table *temporary_tables;
59
Table *getTemporaryTables()
61
return temporary_tables;
65
Mark all temporary tables which were used by the current statement or
66
substatement as free for reuse, but only if the query_id can be cleared.
68
@param session thread context
70
@remark For temp tables associated with a open SQL HANDLER the query_id
71
is not reset until the HANDLER is closed.
48
List of tables that were opened with HANDLER OPEN and are
49
still in use by this thread.
73
void mark_temp_tables_as_free_for_reuse();
76
void close_temporary_tables();
79
void close_temporary_table(Table *table);
82
// The method below just handles the de-allocation of the table. In
83
// a better memory type world, this would not be needed.
84
void nukeTable(Table *table);
87
/* Work with temporary tables */
88
Table *find_temporary_table(const identifier::Table &identifier);
90
void dumpTemporaryTableNames(const char *id);
91
int drop_temporary_table(const drizzled::identifier::Table &identifier);
92
bool rm_temporary_table(plugin::StorageEngine *base, const identifier::Table &identifier);
93
bool rm_temporary_table(const drizzled::identifier::Table &identifier, bool best_effort= false);
94
Table *open_temporary_table(const drizzled::identifier::Table &identifier,
95
bool link_in_list= true);
97
virtual query_id_t getQueryId() const= 0;
51
Table *handler_tables;
100
52
Table *derived_tables;
104
Table *getDerivedTables()
106
return derived_tables;
109
void setDerivedTables(Table *arg)
114
void clearDerivedTables()
117
derived_tables= NULL; // They should all be invalid by this point
121
54
During a MySQL session, one can lock tables in two modes: automatic
122
55
or manual. In automatic mode all necessary tables are locked just before
130
63
the 'LOCK_TABLES' chapter of the MySQL manual.
131
64
See also lock_tables() for details.
68
Tables that were locked with explicit or implicit LOCK TABLES.
69
(Implicit LOCK TABLES happens when we are prelocking tables for
70
execution of statement which uses stored routines. See description
71
Session::prelocked_mode for more info.)
73
DRIZZLE_LOCK *locked_tables;
136
76
CREATE-SELECT keeps an extra lock for the table being
137
77
created. This field is used to keep the extra lock available for
138
78
lower level routines, which would otherwise miss that lock.
140
DrizzleLock *extra_lock;
80
DRIZZLE_LOCK *extra_lock;
143
83
uint32_t current_tablenr;
86
BACKUPS_AVAIL = (1U << 0) /* There are backups available */
90
Flags with information about the open tables state.
146
95
This constructor serves for creation of Open_tables_state instances
147
96
which are used as backup storage.
149
Open_tables_state() :
158
virtual ~Open_tables_state() {}
160
void doGetTableNames(CachedDirectory &directory,
161
const identifier::Schema &schema_identifier,
162
std::set<std::string>& set_of_names);
163
void doGetTableNames(const identifier::Schema &schema_identifier,
164
std::set<std::string>& set_of_names);
166
void doGetTableIdentifiers(CachedDirectory &directory,
167
const identifier::Schema &schema_identifier,
168
identifier::Table::vector &set_of_identifiers);
169
void doGetTableIdentifiers(const identifier::Schema &schema_identifier,
170
identifier::Table::vector &set_of_identifiers);
172
int doGetTableDefinition(const drizzled::identifier::Table &identifier,
173
message::Table &table_proto);
174
bool doDoesTableExist(const drizzled::identifier::Table &identifier);
177
Open_tables_state(uint64_t version_arg);
98
Open_tables_state() : state_flags(0U) { }
100
Open_tables_state(ulong version_arg);
102
void set_open_tables_state(Open_tables_state *state)
107
void reset_open_tables_state()
109
open_tables= temporary_tables= handler_tables= derived_tables= 0;
110
extra_lock= lock= locked_tables= 0;
180
} /* namespace drizzled */
182
115
#endif /* DRIZZLED_OPEN_TABLES_STATE_H */