575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
1 |
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
|
2 |
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
|
|
3 |
*
|
|
4 |
* Copyright (C) 2008 Sun Microsystems
|
|
5 |
*
|
|
6 |
* This program is free software; you can redistribute it and/or modify
|
|
7 |
* it under the terms of the GNU General Public License as published by
|
|
8 |
* the Free Software Foundation; version 2 of the License.
|
|
9 |
*
|
|
10 |
* This program is distributed in the hope that it will be useful,
|
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13 |
* GNU General Public License for more details.
|
|
14 |
*
|
|
15 |
* You should have received a copy of the GNU General Public License
|
|
16 |
* along with this program; if not, write to the Free Software
|
|
17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18 |
*/
|
|
19 |
||
968.2.29
by Monty Taylor
First steps towards new plugin reg. |
20 |
#ifndef DRIZZLED_PLUGIN_STORAGE_ENGINE_H
|
21 |
#define DRIZZLED_PLUGIN_STORAGE_ENGINE_H
|
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
22 |
|
575.4.7
by Monty Taylor
More header cleanup. |
23 |
|
575.1.5
by Monty Taylor
Moved stuff to handlerton.cc |
24 |
#include <drizzled/definitions.h> |
1130.1.1
by Monty Taylor
Merged in plugin-slot-reorg patches. |
25 |
#include <drizzled/plugin.h> |
1039.3.3
by Stewart Smith
Move handler::create to StorageEngine::create_table |
26 |
#include <drizzled/handler_structs.h> |
1812.3.8
by Brian Aker
This switches our schema system over to using a shared ptr. Lets see how |
27 |
#include <drizzled/message.h> |
1910.2.15
by Brian Aker
Update so that we use shared_ptr from the cache throughout more of the |
28 |
#include <drizzled/message/cache.h> |
1130.2.5
by Monty Taylor
Some carnage. I'm sure it'll need fixed. |
29 |
#include "drizzled/plugin/plugin.h" |
1241.9.12
by Monty Taylor
Trims more out of server_includes.h. |
30 |
#include "drizzled/sql_string.h" |
1660.1.1
by Brian Aker
Merge in move identifier work. |
31 |
#include "drizzled/identifier.h" |
1241.9.44
by Monty Taylor
Made magic with cached_directory. |
32 |
#include "drizzled/cached_directory.h" |
1273.1.30
by Jay Pipes
* Completes the blueprint for splitting the XA Resource Manager |
33 |
#include "drizzled/plugin/monitored_in_transaction.h" |
1183.1.5
by Brian Aker
Reworked getTableNames() interface. Way simpler, less mallocs.... |
34 |
|
960.2.40
by Monty Taylor
Made name private. Wow, we just don't use it for anything do we. |
35 |
#include <bitset> |
36 |
#include <string> |
|
971.1.25
by Monty Taylor
Moved StorageEngine onto drizzled::Registry. |
37 |
#include <vector> |
1241.9.44
by Monty Taylor
Made magic with cached_directory. |
38 |
#include <set> |
960.2.40
by Monty Taylor
Made name private. Wow, we just don't use it for anything do we. |
39 |
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
40 |
namespace drizzled |
41 |
{
|
|
42 |
||
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
43 |
class TableList; |
575.1.5
by Monty Taylor
Moved stuff to handlerton.cc |
44 |
class Session; |
1183.1.2
by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted |
45 |
class Cursor; |
1237.9.3
by Padraig O'Sullivan
Removed one the includes I put in server_includes.h for the last commit to get rid of the inclusion |
46 |
typedef struct st_hash HASH; |
575.1.5
by Monty Taylor
Moved stuff to handlerton.cc |
47 |
|
1000.1.3
by Brian Aker
Renamed TABLE_SHARE to TableShare |
48 |
class TableShare; |
1228.1.5
by Monty Taylor
Merged in some naming things. |
49 |
typedef drizzle_lex_string LEX_STRING; |
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
50 |
typedef bool (stat_print_fn)(Session *session, const char *type, uint32_t type_len, |
51 |
const char *file, uint32_t file_len, |
|
52 |
const char *status, uint32_t status_len); |
|
53 |
||
960.2.24
by Monty Taylor
Changed handlerton to StorageEngine. |
54 |
/* Possible flags of a StorageEngine (there can be 32 of them) */
|
960.2.27
by Monty Taylor
Reworked transformed handlerton into class StorageEngine. |
55 |
enum engine_flag_bits { |
631.1.2
by Yoshinori Sano
Move hton_flag_bits and HTON_* to handlerton.h. Remove TODOs previously added. |
56 |
HTON_BIT_ALTER_NOT_SUPPORTED, // Engine does not support alter |
57 |
HTON_BIT_HIDDEN, // Engine does not appear in lists |
|
58 |
HTON_BIT_NOT_USER_SELECTABLE, |
|
59 |
HTON_BIT_TEMPORARY_NOT_SUPPORTED, // Having temporary tables not supported |
|
1063.9.2
by Brian Aker
Committing Stewart's tmp fix |
60 |
HTON_BIT_TEMPORARY_ONLY, |
1183.1.17
by Brian Aker
Added Innodb specific vector (well... for any engine) |
61 |
HTON_BIT_DOES_TRANSACTIONS, |
1233.1.2
by Brian Aker
Move stat read define into engine flags. |
62 |
HTON_BIT_STATS_RECORDS_IS_EXACT, |
1233.1.3
by Brian Aker
Move more of the flags up to engine flags. |
63 |
HTON_BIT_NULL_IN_KEY, |
64 |
HTON_BIT_CAN_INDEX_BLOBS, |
|
1233.1.4
by Brian Aker
Added: |
65 |
HTON_BIT_PRIMARY_KEY_IN_READ_INDEX, |
66 |
HTON_BIT_PARTIAL_COLUMN_READ, |
|
67 |
HTON_BIT_TABLE_SCAN_ON_INDEX, |
|
1233.1.5
by Brian Aker
More table_flags converted. |
68 |
HTON_BIT_FAST_KEY_READ, |
69 |
HTON_BIT_NO_BLOBS, |
|
70 |
HTON_BIT_HAS_RECORDS, |
|
71 |
HTON_BIT_NO_AUTO_INCREMENT, |
|
1233.1.6
by Brian Aker
Remove table_flags from MyISAM. |
72 |
HTON_BIT_DUPLICATE_POS, |
73 |
HTON_BIT_AUTO_PART_KEY, |
|
1233.1.7
by Brian Aker
Final table flag removal. |
74 |
HTON_BIT_REQUIRE_PRIMARY_KEY, |
75 |
HTON_BIT_REQUIRES_KEY_COLUMNS_FOR_DELETE, |
|
76 |
HTON_BIT_PRIMARY_KEY_REQUIRED_FOR_DELETE, |
|
77 |
HTON_BIT_NO_PREFIX_CHAR_KEYS, |
|
78 |
HTON_BIT_HAS_CHECKSUM, |
|
1235.1.2
by Brian Aker
Added engine flag so that an engine can skip store_lock. |
79 |
HTON_BIT_SKIP_STORE_LOCK, |
1273.19.30
by Brian Aker
Performance patch... we now only cycle through engines that actually have |
80 |
HTON_BIT_SCHEMA_DICTIONARY, |
1395.1.3
by Brian Aker
Pass through on refactoring, locks now are wrapped up in layer above. |
81 |
HTON_BIT_FOREIGN_KEYS, |
631.1.2
by Yoshinori Sano
Move hton_flag_bits and HTON_* to handlerton.h. Remove TODOs previously added. |
82 |
HTON_BIT_SIZE
|
83 |
};
|
|
84 |
||
85 |
static const std::bitset<HTON_BIT_SIZE> HTON_NO_FLAGS(0); |
|
86 |
static const std::bitset<HTON_BIT_SIZE> HTON_ALTER_NOT_SUPPORTED(1 << HTON_BIT_ALTER_NOT_SUPPORTED); |
|
87 |
static const std::bitset<HTON_BIT_SIZE> HTON_HIDDEN(1 << HTON_BIT_HIDDEN); |
|
88 |
static const std::bitset<HTON_BIT_SIZE> HTON_NOT_USER_SELECTABLE(1 << HTON_BIT_NOT_USER_SELECTABLE); |
|
89 |
static const std::bitset<HTON_BIT_SIZE> HTON_TEMPORARY_NOT_SUPPORTED(1 << HTON_BIT_TEMPORARY_NOT_SUPPORTED); |
|
1063.9.2
by Brian Aker
Committing Stewart's tmp fix |
90 |
static const std::bitset<HTON_BIT_SIZE> HTON_TEMPORARY_ONLY(1 << HTON_BIT_TEMPORARY_ONLY); |
1183.1.17
by Brian Aker
Added Innodb specific vector (well... for any engine) |
91 |
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_DOES_TRANSACTIONS(1 << HTON_BIT_DOES_TRANSACTIONS); |
1233.1.2
by Brian Aker
Move stat read define into engine flags. |
92 |
static const std::bitset<HTON_BIT_SIZE> HTON_STATS_RECORDS_IS_EXACT(1 << HTON_BIT_STATS_RECORDS_IS_EXACT); |
1233.1.3
by Brian Aker
Move more of the flags up to engine flags. |
93 |
static const std::bitset<HTON_BIT_SIZE> HTON_NULL_IN_KEY(1 << HTON_BIT_NULL_IN_KEY); |
94 |
static const std::bitset<HTON_BIT_SIZE> HTON_CAN_INDEX_BLOBS(1 << HTON_BIT_CAN_INDEX_BLOBS); |
|
1233.1.4
by Brian Aker
Added: |
95 |
static const std::bitset<HTON_BIT_SIZE> HTON_PRIMARY_KEY_IN_READ_INDEX(1 << HTON_BIT_PRIMARY_KEY_IN_READ_INDEX); |
96 |
static const std::bitset<HTON_BIT_SIZE> HTON_PARTIAL_COLUMN_READ(1 << HTON_BIT_PARTIAL_COLUMN_READ); |
|
97 |
static const std::bitset<HTON_BIT_SIZE> HTON_TABLE_SCAN_ON_INDEX(1 << HTON_BIT_TABLE_SCAN_ON_INDEX); |
|
1233.1.5
by Brian Aker
More table_flags converted. |
98 |
static const std::bitset<HTON_BIT_SIZE> HTON_FAST_KEY_READ(1 << HTON_BIT_FAST_KEY_READ); |
99 |
static const std::bitset<HTON_BIT_SIZE> HTON_NO_BLOBS(1 << HTON_BIT_NO_BLOBS); |
|
100 |
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_RECORDS(1 << HTON_BIT_HAS_RECORDS); |
|
1233.1.7
by Brian Aker
Final table flag removal. |
101 |
static const std::bitset<HTON_BIT_SIZE> HTON_NO_AUTO_INCREMENT(1 << HTON_BIT_NO_AUTO_INCREMENT); |
1233.1.6
by Brian Aker
Remove table_flags from MyISAM. |
102 |
static const std::bitset<HTON_BIT_SIZE> HTON_DUPLICATE_POS(1 << HTON_BIT_DUPLICATE_POS); |
103 |
static const std::bitset<HTON_BIT_SIZE> HTON_AUTO_PART_KEY(1 << HTON_BIT_AUTO_PART_KEY); |
|
1233.1.7
by Brian Aker
Final table flag removal. |
104 |
static const std::bitset<HTON_BIT_SIZE> HTON_REQUIRE_PRIMARY_KEY(1 << HTON_BIT_REQUIRE_PRIMARY_KEY); |
105 |
static const std::bitset<HTON_BIT_SIZE> HTON_REQUIRES_KEY_COLUMNS_FOR_DELETE(1 << HTON_BIT_REQUIRES_KEY_COLUMNS_FOR_DELETE); |
|
106 |
static const std::bitset<HTON_BIT_SIZE> HTON_PRIMARY_KEY_REQUIRED_FOR_DELETE(1 << HTON_BIT_PRIMARY_KEY_REQUIRED_FOR_DELETE); |
|
107 |
static const std::bitset<HTON_BIT_SIZE> HTON_NO_PREFIX_CHAR_KEYS(1 << HTON_BIT_NO_PREFIX_CHAR_KEYS); |
|
108 |
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_CHECKSUM(1 << HTON_BIT_HAS_CHECKSUM); |
|
1235.1.2
by Brian Aker
Added engine flag so that an engine can skip store_lock. |
109 |
static const std::bitset<HTON_BIT_SIZE> HTON_SKIP_STORE_LOCK(1 << HTON_BIT_SKIP_STORE_LOCK); |
1273.19.30
by Brian Aker
Performance patch... we now only cycle through engines that actually have |
110 |
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_SCHEMA_DICTIONARY(1 << HTON_BIT_SCHEMA_DICTIONARY); |
1395.1.3
by Brian Aker
Pass through on refactoring, locks now are wrapped up in layer above. |
111 |
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_FOREIGN_KEYS(1 << HTON_BIT_FOREIGN_KEYS); |
1233.1.4
by Brian Aker
Added: |
112 |
|
631.1.2
by Yoshinori Sano
Move hton_flag_bits and HTON_* to handlerton.h. Remove TODOs previously added. |
113 |
|
1039.3.3
by Stewart Smith
Move handler::create to StorageEngine::create_table |
114 |
class Table; |
1273.1.4
by Jay Pipes
This patch significantly reworks the way that |
115 |
class NamedSavepoint; |
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
116 |
|
1130.1.4
by Monty Taylor
Moved StorageEngine into plugin namespace. |
117 |
namespace plugin |
118 |
{
|
|
119 |
||
1273.1.15
by Jay Pipes
This patch completes the first step in the splitting of |
120 |
typedef std::vector<StorageEngine *> EngineVector; |
121 |
||
1309.1.12
by Brian Aker
Cleanup of rm schema; |
122 |
typedef std::set<std::string> TableNameList; |
123 |
||
1228.1.3
by Monty Taylor
All of the outstanding plugin loader system cleanups: |
124 |
extern const std::string UNKNOWN_STRING; |
125 |
extern const std::string DEFAULT_DEFINITION_FILE_EXT; |
|
1130.1.13
by Monty Taylor
Moved some simple methods back into header to they can be inlined. Removed a couple wrapper methods. |
126 |
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
127 |
/*
|
960.2.24
by Monty Taylor
Changed handlerton to StorageEngine. |
128 |
StorageEngine is a singleton structure - one instance per storage engine -
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
129 |
to provide access to storage engine functionality that works on the
|
1183.1.2
by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted |
130 |
"global" level (unlike Cursor class that works on a per-table basis)
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
131 |
|
960.2.24
by Monty Taylor
Changed handlerton to StorageEngine. |
132 |
usually StorageEngine instance is defined statically in ha_xxx.cc as
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
133 |
|
960.2.25
by Monty Taylor
First step of hton rename. |
134 |
static StorageEngine { ... } xxx_engine;
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
135 |
*/
|
1273.1.30
by Jay Pipes
* Completes the blueprint for splitting the XA Resource Manager |
136 |
class StorageEngine : public Plugin, |
137 |
public MonitoredInTransaction |
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
138 |
{
|
1220.2.1
by Brian Aker
Move cursor flags up to storage engine flags. These need to be merged. |
139 |
public: |
140 |
typedef uint64_t Table_flags; |
|
141 |
||
142 |
private: |
|
1183.1.2
by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted |
143 |
const std::bitset<HTON_BIT_SIZE> flags; /* global Cursor flags */ |
964.1.6
by Monty Taylor
Moved savepoint stuff to protected virtual methods, moved the offset to private, and moved the logic about adding the offset to the passed-in pointer and adding the offset to the global offset inside of the class. |
144 |
|
1415
by Brian Aker
Mass overhaul to use schema_identifier. |
145 |
static EngineVector &getSchemaEngines(); |
146 |
||
1273.1.15
by Jay Pipes
This patch completes the first step in the splitting of |
147 |
virtual void setTransactionReadWrite(Session& session); |
1039.3.8
by Stewart Smith
Re-introduce marking transaction as read-write for engine on create_table: |
148 |
|
1273.1.21
by Jay Pipes
* Remove dead ha_innobase::init_table_handle_for_HANDLER() |
149 |
/*
|
150 |
* Indicates to a storage engine the start of a
|
|
151 |
* new SQL statement.
|
|
152 |
*/
|
|
153 |
virtual void doStartStatement(Session *session) |
|
154 |
{
|
|
155 |
(void) session; |
|
156 |
}
|
|
157 |
||
158 |
/*
|
|
159 |
* Indicates to a storage engine the end of
|
|
160 |
* the current SQL statement in the supplied
|
|
161 |
* Session.
|
|
162 |
*/
|
|
163 |
virtual void doEndStatement(Session *session) |
|
164 |
{
|
|
165 |
(void) session; |
|
166 |
}
|
|
167 |
||
964.1.6
by Monty Taylor
Moved savepoint stuff to protected virtual methods, moved the offset to private, and moved the logic about adding the offset to the passed-in pointer and adding the offset to the global offset inside of the class. |
168 |
protected: |
1183.1.27
by Brian Aker
Fix issue where there are too many files in data directory. We now only |
169 |
std::string table_definition_ext; |
170 |
||
171 |
public: |
|
1213
by Brian Aker
Fixes startup failures when temporary tables were left behind in a crash. |
172 |
const std::string& getTableDefinitionFileExtension() |
1183.1.27
by Brian Aker
Fix issue where there are too many files in data directory. We now only |
173 |
{
|
174 |
return table_definition_ext; |
|
175 |
}
|
|
176 |
||
1228.3.1
by Monty Taylor
Removed NameMap. Also remove the aliases from the plugin, since we can just |
177 |
private: |
178 |
std::vector<std::string> aliases; |
|
179 |
||
180 |
public: |
|
181 |
const std::vector<std::string>& getAliases() const |
|
182 |
{
|
|
183 |
return aliases; |
|
184 |
}
|
|
185 |
||
186 |
void addAlias(std::string alias) |
|
187 |
{
|
|
188 |
aliases.push_back(alias); |
|
189 |
}
|
|
190 |
||
1183.1.27
by Brian Aker
Fix issue where there are too many files in data directory. We now only |
191 |
protected: |
964.1.6
by Monty Taylor
Moved savepoint stuff to protected virtual methods, moved the offset to private, and moved the logic about adding the offset to the passed-in pointer and adding the offset to the global offset inside of the class. |
192 |
|
193 |
/**
|
|
1183.1.29
by Brian Aker
Clean up interface so that Truncate sets the propper engine when |
194 |
@brief
|
195 |
Used as a protobuf storage currently by TEMP only engines.
|
|
196 |
*/
|
|
1280.1.10
by Monty Taylor
Put everything in drizzled into drizzled namespace. |
197 |
typedef std::map <std::string, message::Table> ProtoCache; |
1183.1.29
by Brian Aker
Clean up interface so that Truncate sets the propper engine when |
198 |
ProtoCache proto_cache; |
1183.1.30
by Brian Aker
Added engine internal locks (instead of the session based....) |
199 |
pthread_mutex_t proto_cache_mutex; |
1183.1.29
by Brian Aker
Clean up interface so that Truncate sets the propper engine when |
200 |
|
960.2.27
by Monty Taylor
Reworked transformed handlerton into class StorageEngine. |
201 |
public: |
960.2.40
by Monty Taylor
Made name private. Wow, we just don't use it for anything do we. |
202 |
|
1030.1.1
by Brian Aker
Straighten out structures (remove some some dead bits). |
203 |
StorageEngine(const std::string name_arg, |
1273.1.15
by Jay Pipes
This patch completes the first step in the splitting of |
204 |
const std::bitset<HTON_BIT_SIZE> &flags_arg= HTON_NO_FLAGS); |
1030.1.1
by Brian Aker
Straighten out structures (remove some some dead bits). |
205 |
|
206 |
virtual ~StorageEngine(); |
|
207 |
||
1358.1.2
by Brian Aker
Long pass through the system to use more of TableIdentifiers. |
208 |
virtual int doGetTableDefinition(Session &session, |
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
209 |
const drizzled::TableIdentifier &identifier, |
1354.1.1
by Brian Aker
Modify ptr to reference. |
210 |
message::Table &table_message) |
1183.1.11
by Brian Aker
Updating with new engine interface to I_S |
211 |
{
|
1183.1.29
by Brian Aker
Clean up interface so that Truncate sets the propper engine when |
212 |
(void)session; |
1358.1.2
by Brian Aker
Long pass through the system to use more of TableIdentifiers. |
213 |
(void)identifier; |
1354.1.1
by Brian Aker
Modify ptr to reference. |
214 |
(void)table_message; |
1183.1.29
by Brian Aker
Clean up interface so that Truncate sets the propper engine when |
215 |
|
1183.1.11
by Brian Aker
Updating with new engine interface to I_S |
216 |
return ENOENT; |
217 |
}
|
|
1095.3.5
by Stewart Smith
StorageEngine::getTableProto() instead of table_proto_exists. allowing engines to implement their own getTableProtoImpl() to check if table exists. if proto is not null, should fill proto. This is next step (replacing calls to read_table_proto with calls to SE::getTableProto. |
218 |
|
1216.1.1
by Brian Aker
Move print_error up to Engine. |
219 |
/* Old style cursor errors */
|
220 |
protected: |
|
221 |
void print_keydup_error(uint32_t key_nr, const char *msg, Table &table); |
|
222 |
void print_error(int error, myf errflag, Table *table= NULL); |
|
223 |
virtual bool get_error_message(int error, String *buf); |
|
224 |
public: |
|
225 |
virtual void print_error(int error, myf errflag, Table& table); |
|
226 |
||
964.1.4
by Monty Taylor
Moved flags into private area. |
227 |
bool is_user_selectable() const |
228 |
{
|
|
229 |
return not flags.test(HTON_BIT_NOT_USER_SELECTABLE); |
|
230 |
}
|
|
231 |
||
232 |
bool check_flag(const engine_flag_bits flag) const |
|
233 |
{
|
|
234 |
return flags.test(flag); |
|
235 |
}
|
|
236 |
||
1235.1.13
by Brian Aker
Next pass through interface to move index flag bits up to engine. |
237 |
// @todo match check_flag interface
|
238 |
virtual uint32_t index_flags(enum ha_key_alg) const { return 0; } |
|
1273.1.22
by Jay Pipes
Automates registration of statement transaction resources. No more need for storage engines to call TransactionServices::trans_register_ha(session, false, engine). yeah \o/ |
239 |
virtual void startStatement(Session *session) |
1273.1.21
by Jay Pipes
* Remove dead ha_innobase::init_table_handle_for_HANDLER() |
240 |
{
|
241 |
doStartStatement(session); |
|
242 |
}
|
|
1273.1.22
by Jay Pipes
Automates registration of statement transaction resources. No more need for storage engines to call TransactionServices::trans_register_ha(session, false, engine). yeah \o/ |
243 |
virtual void endStatement(Session *session) |
1273.1.21
by Jay Pipes
* Remove dead ha_innobase::init_table_handle_for_HANDLER() |
244 |
{
|
245 |
doEndStatement(session); |
|
246 |
}
|
|
1235.1.13
by Brian Aker
Next pass through interface to move index flag bits up to engine. |
247 |
|
964.1.2
by Monty Taylor
Removed extra space. |
248 |
/*
|
1273.1.32
by Jay Pipes
Fixes Bug #530870 |
249 |
* Called during Session::cleanup() for all engines
|
250 |
*/
|
|
964.1.2
by Monty Taylor
Removed extra space. |
251 |
virtual int close_connection(Session *) |
252 |
{
|
|
253 |
return 0; |
|
254 |
}
|
|
1869.1.4
by Brian Aker
TableShare is no longer in the house (i.e. we no longer directly have a copy |
255 |
virtual Cursor *create(Table &)= 0; |
964.1.2
by Monty Taylor
Removed extra space. |
256 |
/* args: path */
|
257 |
virtual bool flush_logs() { return false; } |
|
258 |
virtual bool show_status(Session *, stat_print_fn *, enum ha_stat_type) |
|
259 |
{
|
|
260 |
return false; |
|
261 |
}
|
|
262 |
||
1039.3.1
by Stewart Smith
move bas_ext to StorageEngine instead of handler |
263 |
/**
|
264 |
If frm_error() is called then we will use this to find out what file
|
|
265 |
extentions exist for the storage engine. This is also used by the default
|
|
1183.1.2
by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted |
266 |
rename_table and delete_table method in Cursor.cc.
|
1039.3.1
by Stewart Smith
move bas_ext to StorageEngine instead of handler |
267 |
|
268 |
For engines that have two file name extentions (separate meta/index file
|
|
269 |
and data file), the order of elements is relevant. First element of engine
|
|
270 |
file name extentions array should be meta/index file extention. Second
|
|
271 |
element - data file extention. This order is assumed by
|
|
272 |
prepare_for_repair() when REPAIR Table ... USE_FRM is issued.
|
|
273 |
*/
|
|
274 |
virtual const char **bas_ext() const =0; |
|
275 |
||
1039.3.9
by Stewart Smith
beat identifiers with an ugly stick (otherwise known as "coding standards" and s/create_table/createTable/) |
276 |
protected: |
1413
by Brian Aker
doCreateTable() was still taking a pointer instead of a session reference. |
277 |
virtual int doCreateTable(Session &session, |
278 |
Table &table_arg, |
|
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
279 |
const drizzled::TableIdentifier &identifier, |
1413
by Brian Aker
doCreateTable() was still taking a pointer instead of a session reference. |
280 |
message::Table &message)= 0; |
1095.3.29
by Stewart Smith
s/Impl/Implementation/ |
281 |
|
1390
by Brian Aker
Update interface to use Identifiers directly. |
282 |
virtual int doRenameTable(Session &session, |
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
283 |
const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to)= 0; |
1095.3.29
by Stewart Smith
s/Impl/Implementation/ |
284 |
|
1039.3.9
by Stewart Smith
beat identifiers with an ugly stick (otherwise known as "coding standards" and s/create_table/createTable/) |
285 |
public: |
1039.3.8
by Stewart Smith
Re-introduce marking transaction as read-write for engine on create_table: |
286 |
|
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
287 |
int renameTable(Session &session, const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to); |
1039.3.3
by Stewart Smith
Move handler::create to StorageEngine::create_table |
288 |
|
1429.1.3
by Brian Aker
Merge in work for fetching a list of table identifiers. |
289 |
virtual void doGetTableIdentifiers(CachedDirectory &directory, |
1642
by Brian Aker
This adds const to SchemaIdentifier. |
290 |
const drizzled::SchemaIdentifier &schema_identifier, |
1966.2.4
by Brian Aker
Style cleanup. |
291 |
TableIdentifier::vector &set_of_identifiers)= 0; |
1358.1.3
by Brian Aker
doDropTable() now only uses identifier. |
292 |
|
1358.1.2
by Brian Aker
Long pass through the system to use more of TableIdentifiers. |
293 |
virtual int doDropTable(Session &session, |
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
294 |
const drizzled::TableIdentifier &identifier)= 0; |
1183.1.5
by Brian Aker
Reworked getTableNames() interface. Way simpler, less mallocs.... |
295 |
|
1160.1.1
by Brian Aker
Refactor SE createTable back to engine class. |
296 |
/* Class Methods for operating on plugin */
|
1130.1.19
by Monty Taylor
Added error reporting to plugin registration. |
297 |
static bool addPlugin(plugin::StorageEngine *engine); |
1130.1.18
by Monty Taylor
Changed ::add() and ::remove() to ::addPlugin() and ::removePlugin() so that |
298 |
static void removePlugin(plugin::StorageEngine *engine); |
1130.1.12
by Monty Taylor
Moved service stuff into plugin/ |
299 |
|
1183.1.29
by Brian Aker
Clean up interface so that Truncate sets the propper engine when |
300 |
static int getTableDefinition(Session& session, |
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
301 |
const drizzled::TableIdentifier &identifier, |
1938.4.2
by Brian Aker
Fix style issue around table for message (though this is imperfect,...) |
302 |
message::table::shared_ptr &table_proto, |
1273.19.11
by Brian Aker
This restores temporary tables back to being viewable via show/select. |
303 |
bool include_temporary_tables= true); |
1358.1.1
by Brian Aker
Fixes regression in performance from Exists patch. |
304 |
static bool doesTableExist(Session &session, |
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
305 |
const drizzled::TableIdentifier &identifier, |
1273.19.11
by Brian Aker
This restores temporary tables back to being viewable via show/select. |
306 |
bool include_temporary_tables= true); |
1130.1.12
by Monty Taylor
Moved service stuff into plugin/ |
307 |
|
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
308 |
virtual bool doDoesTableExist(Session& session, const drizzled::TableIdentifier &identifier); |
1358.1.1
by Brian Aker
Fixes regression in performance from Exists patch. |
309 |
|
1384
by Brian Aker
Merge |
310 |
static plugin::StorageEngine *findByName(const std::string &find_str); |
311 |
static plugin::StorageEngine *findByName(Session& session, const std::string &find_str); |
|
312 |
||
1130.1.12
by Monty Taylor
Moved service stuff into plugin/ |
313 |
static void closeConnection(Session* session); |
314 |
static void dropDatabase(char* path); |
|
315 |
static bool flushLogs(plugin::StorageEngine *db_type); |
|
1223.4.16
by Brian Aker
Drop Table now uses identifier. |
316 |
static int dropTable(Session& session, |
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
317 |
const drizzled::TableIdentifier &identifier); |
1395.1.12
by Brian Aker
Fixes failure related to Heap's hack on deletion. Also cleans up error |
318 |
static int dropTable(Session& session, |
319 |
StorageEngine &engine, |
|
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
320 |
const drizzled::TableIdentifier &identifier); |
1663.1.4
by Brian Aker
Removed identifier bit |
321 |
static void getIdentifiers(Session &session, |
322 |
const SchemaIdentifier &schema_identifier, |
|
1966.2.4
by Brian Aker
Style cleanup. |
323 |
TableIdentifier::vector &set_of_identifiers); |
1183.1.5
by Brian Aker
Reworked getTableNames() interface. Way simpler, less mallocs.... |
324 |
|
1320.1.8
by Brian Aker
Temporary fix for allowing engines to say "don't do this". |
325 |
// Check to see if any SE objects to creation.
|
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
326 |
static bool canCreateTable(const drizzled::TableIdentifier &identifier); |
327 |
virtual bool doCanCreateTable(const drizzled::TableIdentifier &identifier) |
|
1320.1.8
by Brian Aker
Temporary fix for allowing engines to say "don't do this". |
328 |
{ (void)identifier; return true; } |
329 |
||
1273.13.38
by Brian Aker
Add in new show work. |
330 |
// @note All schema methods defined here
|
1966.2.3
by Brian Aker
Fix another style issue. |
331 |
static void getIdentifiers(Session &session, SchemaIdentifier::vector &schemas); |
1966.2.1
by Brian Aker
Clean up style for shared_ptr for messages around table/schema. |
332 |
static bool getSchemaDefinition(const drizzled::TableIdentifier &identifier, message::schema::shared_ptr &proto); |
333 |
static bool getSchemaDefinition(const drizzled::SchemaIdentifier &identifier, message::schema::shared_ptr &proto); |
|
1642
by Brian Aker
This adds const to SchemaIdentifier. |
334 |
static bool doesSchemaExist(const drizzled::SchemaIdentifier &identifier); |
335 |
static const CHARSET_INFO *getSchemaCollation(const drizzled::SchemaIdentifier &identifier); |
|
1856.2.8
by Joseph Daly
working alter, drop, create schema |
336 |
static bool createSchema(const drizzled::message::Schema &schema_message); |
1642
by Brian Aker
This adds const to SchemaIdentifier. |
337 |
static bool dropSchema(const drizzled::SchemaIdentifier &identifier); |
1273.19.26
by Brian Aker
Move Alter schema to SE interface. |
338 |
static bool alterSchema(const drizzled::message::Schema &schema_message); |
1273.20.2
by Brian Aker
Adding on more bits for schema engine. |
339 |
|
1273.20.1
by Brian Aker
Basic engine with test. |
340 |
// @note make private/protected
|
1966.2.3
by Brian Aker
Fix another style issue. |
341 |
virtual void doGetSchemaIdentifiers(SchemaIdentifier::vector&) |
1415
by Brian Aker
Mass overhaul to use schema_identifier. |
342 |
{ } |
1273.20.2
by Brian Aker
Adding on more bits for schema engine. |
343 |
|
1966.2.1
by Brian Aker
Clean up style for shared_ptr for messages around table/schema. |
344 |
virtual bool doGetSchemaDefinition(const drizzled::SchemaIdentifier&, drizzled::message::schema::shared_ptr&) |
1273.20.2
by Brian Aker
Adding on more bits for schema engine. |
345 |
{
|
346 |
return false; |
|
347 |
}
|
|
1273.13.9
by Brian Aker
Updating test cases + added Drizzle specific schema_names and schema_info. |
348 |
|
1856.2.8
by Joseph Daly
working alter, drop, create schema |
349 |
virtual bool doCreateSchema(const drizzled::message::Schema&) |
1856.2.10
by Joseph Daly
fix up non diff |
350 |
{ return false; } |
1415
by Brian Aker
Mass overhaul to use schema_identifier. |
351 |
|
352 |
virtual bool doAlterSchema(const drizzled::message::Schema&) |
|
1856.2.10
by Joseph Daly
fix up non diff |
353 |
{ return false; } |
1415
by Brian Aker
Mass overhaul to use schema_identifier. |
354 |
|
1642
by Brian Aker
This adds const to SchemaIdentifier. |
355 |
virtual bool doDropSchema(const drizzled::SchemaIdentifier&) |
1856.2.10
by Joseph Daly
fix up non diff |
356 |
{ return false; } |
1273.19.31
by Brian Aker
Fix dropSchema(). |
357 |
|
1130.1.13
by Monty Taylor
Moved some simple methods back into header to they can be inlined. Removed a couple wrapper methods. |
358 |
static inline const std::string &resolveName(const StorageEngine *engine) |
359 |
{
|
|
360 |
return engine == NULL ? UNKNOWN_STRING : engine->getName(); |
|
361 |
}
|
|
1130.1.12
by Monty Taylor
Moved service stuff into plugin/ |
362 |
|
1223.4.15
by Brian Aker
Final step to make createTable() use the TableIdentifier. |
363 |
static int createTable(Session& session, |
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
364 |
const drizzled::TableIdentifier &identifier, |
1320.1.6
by Brian Aker
Remove unused createTable() option |
365 |
message::Table& table_proto); |
1183.1.1
by Brian Aker
Rework interface pieces on SE (sort of... dumb ones...) |
366 |
|
1213
by Brian Aker
Fixes startup failures when temporary tables were left behind in a crash. |
367 |
static void removeLostTemporaryTables(Session &session, const char *directory); |
368 |
||
1869.1.4
by Brian Aker
TableShare is no longer in the house (i.e. we no longer directly have a copy |
369 |
Cursor *getCursor(Table &share); |
1233.1.9
by Brian Aker
Move max key stuff up to engine. |
370 |
|
371 |
uint32_t max_record_length() const |
|
372 |
{ return std::min((unsigned int)HA_MAX_REC_LENGTH, max_supported_record_length()); } |
|
373 |
uint32_t max_keys() const |
|
374 |
{ return std::min((unsigned int)MAX_KEY, max_supported_keys()); } |
|
375 |
uint32_t max_key_parts() const |
|
376 |
{ return std::min((unsigned int)MAX_REF_PARTS, max_supported_key_parts()); } |
|
377 |
uint32_t max_key_length() const |
|
378 |
{ return std::min((unsigned int)MAX_KEY_LENGTH, max_supported_key_length()); } |
|
379 |
uint32_t max_key_part_length(void) const |
|
380 |
{ return std::min((unsigned int)MAX_KEY_LENGTH, max_supported_key_part_length()); } |
|
381 |
||
382 |
virtual uint32_t max_supported_record_length(void) const |
|
383 |
{ return HA_MAX_REC_LENGTH; } |
|
384 |
virtual uint32_t max_supported_keys(void) const { return 0; } |
|
385 |
virtual uint32_t max_supported_key_parts(void) const { return MAX_REF_PARTS; } |
|
386 |
virtual uint32_t max_supported_key_length(void) const { return MAX_KEY_LENGTH; } |
|
387 |
virtual uint32_t max_supported_key_part_length(void) const { return 255; } |
|
388 |
||
1237.6.12
by Brian Aker
Adding patch for engine methods for definition files. |
389 |
/* TODO-> Make private */
|
1618.1.1
by Brian Aker
Modify TableIdentifier to be const |
390 |
static int deleteDefinitionFromPath(const drizzled::TableIdentifier &identifier); |
391 |
static int renameDefinitionFromPath(const drizzled::TableIdentifier &dest, const drizzled::TableIdentifier &src); |
|
392 |
static int writeDefinitionFromPath(const drizzled::TableIdentifier &identifier, message::Table &proto); |
|
1395.1.8
by Brian Aker
Cleanup usage of TI so that the NULL ones no longer exist. |
393 |
static bool readTableFile(const std::string &path, message::Table &table_message); |
1273.1.30
by Jay Pipes
* Completes the blueprint for splitting the XA Resource Manager |
394 |
|
395 |
public: |
|
396 |
/*
|
|
397 |
* The below are simple virtual overrides for the plugin::MonitoredInTransaction
|
|
398 |
* interface.
|
|
399 |
*/
|
|
400 |
virtual bool participatesInSqlTransaction() const |
|
401 |
{
|
|
402 |
return false; /* plugin::StorageEngine is non-transactional in terms of SQL */ |
|
403 |
}
|
|
404 |
virtual bool participatesInXaTransaction() const |
|
405 |
{
|
|
406 |
return false; /* plugin::StorageEngine is non-transactional in terms of XA */ |
|
407 |
}
|
|
408 |
virtual bool alwaysRegisterForXaTransaction() const |
|
409 |
{
|
|
410 |
return false; |
|
411 |
}
|
|
1502.1.30
by Brian Aker
First pass on cleanup of Stewart's patch, plus re-engineer to make it work a |
412 |
|
413 |
virtual bool validateCreateTableOption(const std::string &key, const std::string &state) |
|
414 |
{
|
|
415 |
(void)key; |
|
416 |
(void)state; |
|
417 |
||
418 |
return false; |
|
419 |
}
|
|
420 |
||
421 |
virtual bool validateCreateSchemaOption(const std::string &key, const std::string &state) |
|
422 |
{
|
|
423 |
(void)key; |
|
424 |
(void)state; |
|
425 |
||
426 |
return false; |
|
427 |
}
|
|
575.1.3
by Monty Taylor
Moved some stuff out of handler.h. |
428 |
};
|
429 |
||
1130.1.4
by Monty Taylor
Moved StorageEngine into plugin namespace. |
430 |
} /* namespace plugin */ |
431 |
} /* namespace drizzled */ |
|
432 |
||
968.2.29
by Monty Taylor
First steps towards new plugin reg. |
433 |
#endif /* DRIZZLED_PLUGIN_STORAGE_ENGINE_H */ |