00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <drizzled/common_fwd.h>
00023 #include <drizzled/lock.h>
00024
00025 namespace drizzled {
00026
00027 extern uint64_t g_refresh_version;
00028
00034 class Open_tables_state
00035 {
00036 public:
00041 Table *open_tables_;
00042
00050 Table *temporary_tables;
00051
00052 Table *getTemporaryTables()
00053 {
00054 return temporary_tables;
00055 }
00056
00066 void mark_temp_tables_as_free_for_reuse();
00067 void close_temporary_tables();
00068 void close_temporary_table(Table*);
00069 void nukeTable(Table*);
00070 void close_open_tables();
00071 bool free_cached_table();
00072
00073
00074 Table *find_temporary_table(const identifier::Table &identifier);
00075
00076 void dumpTemporaryTableNames(const char *id);
00077 int drop_temporary_table(const identifier::Table&);
00078 bool rm_temporary_table(plugin::StorageEngine&, const identifier::Table&);
00079 bool rm_temporary_table(const identifier::Table &identifier, bool best_effort= false);
00080
00081 private:
00082 Table *derived_tables;
00083 public:
00084
00085
00086 Table *getDerivedTables()
00087 {
00088 return derived_tables;
00089 }
00090
00091 void setDerivedTables(Table *arg)
00092 {
00093 derived_tables= arg;
00094 }
00095
00096 void clearDerivedTables()
00097 {
00098 derived_tables= NULL;
00099 }
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114 DrizzleLock *lock;
00115
00116
00117
00118
00119
00120
00121 DrizzleLock *extra_lock;
00122
00123 uint64_t version;
00124 uint32_t current_tablenr;
00125
00126 Open_tables_state(Session&, uint64_t version_arg);
00127 void doGetTableNames(CachedDirectory&, const identifier::Schema&, std::set<std::string>&);
00128 void doGetTableNames(const identifier::Schema&, std::set<std::string>&);
00129 void doGetTableIdentifiers(CachedDirectory&, const identifier::Schema&, identifier::table::vector&);
00130 void doGetTableIdentifiers(const identifier::Schema&, identifier::table::vector&);
00131 int doGetTableDefinition(const drizzled::identifier::Table&, message::Table&);
00132 bool doDoesTableExist(const drizzled::identifier::Table&);
00133 private:
00134 Session& session_;
00135 };
00136
00137 }
00138