~drizzle-trunk/drizzle/development

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>
1067.1.8 by Stewart Smith
start passing down table proto to createTable. This enables future code cleanup, including fixing ARCHIVE embedding table definition and table proto in parser
27
#include <drizzled/message/table.pb.h>
1130.2.5 by Monty Taylor
Some carnage. I'm sure it'll need fixed.
28
#include "drizzled/plugin/plugin.h"
1130.3.11 by Monty Taylor
Renamed drizzled::Registry to drizzled::NameMap to reduce confusion.
29
#include <drizzled/name_map.h>
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
30
1183.1.5 by Brian Aker
Reworked getTableNames() interface. Way simpler, less mallocs....
31
#include "mysys/cached_directory.h"
32
960.2.40 by Monty Taylor
Made name private. Wow, we just don't use it for anything do we.
33
#include <bitset>
34
#include <string>
971.1.25 by Monty Taylor
Moved StorageEngine onto drizzled::Registry.
35
#include <vector>
960.2.40 by Monty Taylor
Made name private. Wow, we just don't use it for anything do we.
36
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
37
class TableList;
575.1.5 by Monty Taylor
Moved stuff to handlerton.cc
38
class Session;
39
class XID;
1183.1.2 by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted
40
class Cursor;
575.1.5 by Monty Taylor
Moved stuff to handlerton.cc
41
1000.1.3 by Brian Aker
Renamed TABLE_SHARE to TableShare
42
class TableShare;
575.1.5 by Monty Taylor
Moved stuff to handlerton.cc
43
typedef struct st_mysql_lex_string LEX_STRING;
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
44
typedef bool (stat_print_fn)(Session *session, const char *type, uint32_t type_len,
45
                             const char *file, uint32_t file_len,
46
                             const char *status, uint32_t status_len);
47
960.2.24 by Monty Taylor
Changed handlerton to StorageEngine.
48
/* Possible flags of a StorageEngine (there can be 32 of them) */
960.2.27 by Monty Taylor
Reworked transformed handlerton into class StorageEngine.
49
enum engine_flag_bits {
631.1.2 by Yoshinori Sano
Move hton_flag_bits and HTON_* to handlerton.h. Remove TODOs previously added.
50
  HTON_BIT_ALTER_NOT_SUPPORTED,       // Engine does not support alter
51
  HTON_BIT_HIDDEN,                    // Engine does not appear in lists
52
  HTON_BIT_FLUSH_AFTER_RENAME,
53
  HTON_BIT_NOT_USER_SELECTABLE,
54
  HTON_BIT_TEMPORARY_NOT_SUPPORTED,   // Having temporary tables not supported
1063.9.2 by Brian Aker
Committing Stewart's tmp fix
55
  HTON_BIT_TEMPORARY_ONLY,
1095.3.14 by Brian Aker
Moved file based flag up to engine (from handler). checkLowercaseNames() is now a ember of StorageEngine.
56
  HTON_BIT_FILE_BASED, // use for check_lowercase_names
1095.3.19 by Stewart Smith
remove need to write table proto to disk in .dfe if engine can handle it (new StorageEngine flag). Also fix up delete_table_proto code paths to work properly with engines handling their own protos. This commit breaks SHOW TABLES for ARCHIVE, hence the drizzledump test. Will be fixed in future commit
57
  HTON_BIT_HAS_DATA_DICTIONARY,
1183.1.17 by Brian Aker
Added Innodb specific vector (well... for any engine)
58
  HTON_BIT_DOES_TRANSACTIONS,
631.1.2 by Yoshinori Sano
Move hton_flag_bits and HTON_* to handlerton.h. Remove TODOs previously added.
59
  HTON_BIT_SIZE
60
};
61
62
static const std::bitset<HTON_BIT_SIZE> HTON_NO_FLAGS(0);
63
static const std::bitset<HTON_BIT_SIZE> HTON_ALTER_NOT_SUPPORTED(1 << HTON_BIT_ALTER_NOT_SUPPORTED);
64
static const std::bitset<HTON_BIT_SIZE> HTON_HIDDEN(1 << HTON_BIT_HIDDEN);
65
static const std::bitset<HTON_BIT_SIZE> HTON_FLUSH_AFTER_RENAME(1 << HTON_BIT_FLUSH_AFTER_RENAME);
66
static const std::bitset<HTON_BIT_SIZE> HTON_NOT_USER_SELECTABLE(1 << HTON_BIT_NOT_USER_SELECTABLE);
67
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
68
static const std::bitset<HTON_BIT_SIZE> HTON_TEMPORARY_ONLY(1 << HTON_BIT_TEMPORARY_ONLY);
1095.3.14 by Brian Aker
Moved file based flag up to engine (from handler). checkLowercaseNames() is now a ember of StorageEngine.
69
static const std::bitset<HTON_BIT_SIZE> HTON_FILE_BASED(1 << HTON_BIT_FILE_BASED);
1095.3.19 by Stewart Smith
remove need to write table proto to disk in .dfe if engine can handle it (new StorageEngine flag). Also fix up delete_table_proto code paths to work properly with engines handling their own protos. This commit breaks SHOW TABLES for ARCHIVE, hence the drizzledump test. Will be fixed in future commit
70
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_DATA_DICTIONARY(1 << HTON_BIT_HAS_DATA_DICTIONARY);
1183.1.17 by Brian Aker
Added Innodb specific vector (well... for any engine)
71
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_DOES_TRANSACTIONS(1 << HTON_BIT_DOES_TRANSACTIONS);
631.1.2 by Yoshinori Sano
Move hton_flag_bits and HTON_* to handlerton.h. Remove TODOs previously added.
72
1039.3.3 by Stewart Smith
Move handler::create to StorageEngine::create_table
73
class Table;
1130.1.4 by Monty Taylor
Moved StorageEngine into plugin namespace.
74
75
namespace drizzled
76
{
77
namespace plugin
78
{
79
1130.1.13 by Monty Taylor
Moved some simple methods back into header to they can be inlined. Removed a couple wrapper methods.
80
const std::string UNKNOWN_STRING("UNKNOWN");
1183.1.27 by Brian Aker
Fix issue where there are too many files in data directory. We now only
81
const std::string DEFAULT_DEFINITION_FILE_EXT(".dfe");
82
    
1130.1.13 by Monty Taylor
Moved some simple methods back into header to they can be inlined. Removed a couple wrapper methods.
83
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
84
/*
960.2.24 by Monty Taylor
Changed handlerton to StorageEngine.
85
  StorageEngine is a singleton structure - one instance per storage engine -
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
86
  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
87
  "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.
88
960.2.24 by Monty Taylor
Changed handlerton to StorageEngine.
89
  usually StorageEngine instance is defined statically in ha_xxx.cc as
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
90
960.2.25 by Monty Taylor
First step of hton rename.
91
  static StorageEngine { ... } xxx_engine;
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
92
93
  savepoint_*, prepare, recover, and *_by_xid pointers can be 0.
94
*/
1130.2.5 by Monty Taylor
Some carnage. I'm sure it'll need fixed.
95
class StorageEngine : public Plugin
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
96
{
1220.2.1 by Brian Aker
Move cursor flags up to storage engine flags. These need to be merged.
97
public:
98
  typedef uint64_t Table_flags;
99
100
private:
101
960.2.41 by Monty Taylor
Made StorageEngine name private. Added constructor param and accessor method.
102
  /*
103
    Name used for storage engine.
104
  */
964.1.5 by Monty Taylor
Removed license field from StorageEngine. It was not used. Also added a const specifier.
105
  const bool two_phase_commit;
964.1.3 by Monty Taylor
Refactored state into is_enabled() call.
106
  bool enabled;
1030.1.1 by Brian Aker
Straighten out structures (remove some some dead bits).
107
1183.1.2 by Brian Aker
Rename of handler to Cursor. You would not believe how long I have wanted
108
  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.
109
  /*
110
    to store per-savepoint data storage engine is provided with an area
111
    of a requested size (0 is ok here).
112
    savepoint_offset must be initialized statically to the size of
113
    the needed memory to store per-savepoint information.
114
    After xxx_init it is changed to be an offset to savepoint storage
115
    area and need not be used by storage engine.
116
    see binlog_engine and binlog_savepoint_set/rollback for an example.
117
  */
118
  size_t savepoint_offset;
119
  size_t orig_savepoint_offset;
120
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
121
  void setTransactionReadWrite(Session& session);
1039.3.8 by Stewart Smith
Re-introduce marking transaction as read-write for engine on create_table:
122
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.
123
protected:
1183.1.27 by Brian Aker
Fix issue where there are too many files in data directory. We now only
124
  std::string table_definition_ext;
125
126
public:
1213 by Brian Aker
Fixes startup failures when temporary tables were left behind in a crash.
127
  const std::string& getTableDefinitionFileExtension()
1183.1.27 by Brian Aker
Fix issue where there are too many files in data directory. We now only
128
  {
129
    return table_definition_ext;
130
  }
131
132
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.
133
134
  /**
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
135
    @brief
136
    Used as a protobuf storage currently by TEMP only engines.
137
  */
138
  typedef std::map <std::string, drizzled::message::Table> ProtoCache;
139
  ProtoCache proto_cache;
1183.1.30 by Brian Aker
Added engine internal locks (instead of the session based....)
140
  pthread_mutex_t proto_cache_mutex;
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
141
142
  /**
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.
143
   * Implementing classes should override these to provide savepoint
144
   * functionality.
145
   */
146
  virtual int savepoint_set_hook(Session *, void *) { return 0; }
147
148
  virtual int savepoint_rollback_hook(Session *, void *) { return 0; }
149
150
  virtual int savepoint_release_hook(Session *, void *) { return 0; }
960.2.41 by Monty Taylor
Made StorageEngine name private. Added constructor param and accessor method.
151
960.2.27 by Monty Taylor
Reworked transformed handlerton into class StorageEngine.
152
public:
960.2.40 by Monty Taylor
Made name private. Wow, we just don't use it for anything do we.
153
1030.1.1 by Brian Aker
Straighten out structures (remove some some dead bits).
154
  StorageEngine(const std::string name_arg,
155
                const std::bitset<HTON_BIT_SIZE> &flags_arg= HTON_NO_FLAGS,
156
                size_t savepoint_offset_arg= 0,
157
                bool support_2pc= false);
158
159
  virtual ~StorageEngine();
160
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
161
  virtual int doGetTableDefinition(Session& session,
162
                                   const char *path,
1183.5.1 by Brian Aker
Extended definition interface (filename building should now be moved
163
                                   const char *db,
164
                                   const char *table_name,
165
                                   const bool is_tmp,
1183.1.22 by Brian Aker
Merge Name changes
166
                                   drizzled::message::Table *table_proto)
1183.1.11 by Brian Aker
Updating with new engine interface to I_S
167
  {
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
168
    (void)session;
1183.1.11 by Brian Aker
Updating with new engine interface to I_S
169
    (void)path;
1183.5.1 by Brian Aker
Extended definition interface (filename building should now be moved
170
    (void)db;
171
    (void)table_name;
172
    (void)is_tmp;
1183.1.11 by Brian Aker
Updating with new engine interface to I_S
173
    (void)table_proto;
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
174
1183.1.11 by Brian Aker
Updating with new engine interface to I_S
175
    return ENOENT;
176
  }
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.
177
1216.1.1 by Brian Aker
Move print_error up to Engine.
178
  /* Old style cursor errors */
179
protected:
180
  void print_keydup_error(uint32_t key_nr, const char *msg, Table &table);
181
  void print_error(int error, myf errflag, Table *table= NULL);
182
  virtual bool get_error_message(int error, String *buf);
183
public:
184
  virtual void print_error(int error, myf errflag, Table& table);
185
584.2.5 by Stewart Smith
store a protobuf tabledefinition along with FRM
186
  /*
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
187
    each storage engine has it's own memory area (actually a pointer)
188
    in the session, for storing per-connection information.
189
    It is accessed as
190
960.2.25 by Monty Taylor
First step of hton rename.
191
      session->ha_data[xxx_engine.slot]
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
192
193
   slot number is initialized by MySQL after xxx_init() is called.
964.1.2 by Monty Taylor
Removed extra space.
194
  */
195
  uint32_t slot;
964.1.4 by Monty Taylor
Moved flags into private area.
196
1220.2.1 by Brian Aker
Move cursor flags up to storage engine flags. These need to be merged.
197
  virtual Table_flags table_flags(void) const= 0;
198
1030.1.1 by Brian Aker
Straighten out structures (remove some some dead bits).
199
  inline uint32_t getSlot (void) { return slot; }
200
  inline void setSlot (uint32_t value) { slot= value; }
960.2.45 by Monty Taylor
How about let's initialize savepoint_offset.
201
202
  bool has_2pc()
203
  {
964.1.1 by Monty Taylor
Renamed _2pc to two_phase_commit.
204
    return two_phase_commit;
960.2.45 by Monty Taylor
How about let's initialize savepoint_offset.
205
  }
206
207
964.1.2 by Monty Taylor
Removed extra space.
208
  bool is_enabled() const
209
  {
964.1.3 by Monty Taylor
Refactored state into is_enabled() call.
210
    return enabled;
964.1.2 by Monty Taylor
Removed extra space.
211
  }
212
964.1.4 by Monty Taylor
Moved flags into private area.
213
  bool is_user_selectable() const
214
  {
215
    return not flags.test(HTON_BIT_NOT_USER_SELECTABLE);
216
  }
217
218
  bool check_flag(const engine_flag_bits flag) const
219
  {
220
    return flags.test(flag);
221
  }
222
964.1.3 by Monty Taylor
Refactored state into is_enabled() call.
223
  void enable() { enabled= true; }
224
  void disable() { enabled= false; }
225
964.1.2 by Monty Taylor
Removed extra space.
226
  /*
227
    StorageEngine methods:
228
229
    close_connection is only called if
230
    session->ha_data[xxx_engine.slot] is non-zero, so even if you don't need
231
    this storage area - set it to something, so that MySQL would know
232
    this storage engine was accessed in this connection
233
  */
234
  virtual int close_connection(Session  *)
235
  {
236
    return 0;
237
  }
238
  /*
239
    'all' is true if it's a real commit, that makes persistent changes
240
    'all' is false if it's not in fact a commit but an end of the
241
    statement that is part of the transaction.
242
    NOTE 'all' is also false in auto-commit mode where 'end of statement'
243
    and 'real commit' mean the same event.
244
  */
245
  virtual int  commit(Session *, bool)
246
  {
247
    return 0;
248
  }
249
250
  virtual int  rollback(Session *, bool)
251
  {
252
    return 0;
253
  }
254
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.
255
  /*
256
    The void * points to an uninitialized storage area of requested size
257
    (see savepoint_offset description)
258
  */
259
  int savepoint_set(Session *session, void *sp)
260
  {
261
    return savepoint_set_hook(session, (unsigned char *)sp+savepoint_offset);
262
  }
263
264
  /*
265
    The void * points to a storage area, that was earlier passed
266
    to the savepoint_set call
267
  */
268
  int savepoint_rollback(Session *session, void *sp)
269
  {
270
     return savepoint_rollback_hook(session,
271
                                    (unsigned char *)sp+savepoint_offset);
272
  }
273
274
  int savepoint_release(Session *session, void *sp)
275
  {
276
    return savepoint_release_hook(session,
277
                                  (unsigned char *)sp+savepoint_offset);
278
  }
279
964.1.2 by Monty Taylor
Removed extra space.
280
  virtual int  prepare(Session *, bool) { return 0; }
281
  virtual int  recover(XID *, uint32_t) { return 0; }
282
  virtual int  commit_by_xid(XID *) { return 0; }
283
  virtual int  rollback_by_xid(XID *) { return 0; }
1208.3.2 by brian
Update for Cursor renaming.
284
  virtual Cursor *create(TableShare &, MEM_ROOT *)= 0;
964.1.2 by Monty Taylor
Removed extra space.
285
  /* args: path */
286
  virtual void drop_database(char*) { }
287
  virtual int start_consistent_snapshot(Session *) { return 0; }
288
  virtual bool flush_logs() { return false; }
289
  virtual bool show_status(Session *, stat_print_fn *, enum ha_stat_type)
290
  {
291
    return false;
292
  }
293
294
  /* args: current_session, tables, cond */
295
  virtual int fill_files_table(Session *, TableList *,
296
                               Item *) { return 0; }
297
  virtual int release_temporary_latches(Session *) { return false; }
298
1039.3.1 by Stewart Smith
move bas_ext to StorageEngine instead of handler
299
  /**
300
    If frm_error() is called then we will use this to find out what file
301
    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
302
    rename_table and delete_table method in Cursor.cc.
1039.3.1 by Stewart Smith
move bas_ext to StorageEngine instead of handler
303
304
    For engines that have two file name extentions (separate meta/index file
305
    and data file), the order of elements is relevant. First element of engine
306
    file name extentions array should be meta/index file extention. Second
307
    element - data file extention. This order is assumed by
308
    prepare_for_repair() when REPAIR Table ... USE_FRM is issued.
309
  */
310
  virtual const char **bas_ext() const =0;
311
1039.3.9 by Stewart Smith
beat identifiers with an ugly stick (otherwise known as "coding standards" and s/create_table/createTable/)
312
protected:
1183.1.6 by Brian Aker
Simplify createTable()
313
  virtual int doCreateTable(Session *session,
314
                            const char *table_name,
1183.1.18 by Brian Aker
Fixed references to doCreateTable()
315
                            Table& table_arg,
1183.1.20 by Brian Aker
Quick pass through ha_create in doTableCreate() to turn it into a reference.
316
                            HA_CREATE_INFO& create_info,
1183.1.18 by Brian Aker
Fixed references to doCreateTable()
317
                            drizzled::message::Table& proto)= 0;
1095.3.29 by Stewart Smith
s/Impl/Implementation/
318
1183.1.7 by Brian Aker
Fix name conventions for rename table
319
  virtual int doRenameTable(Session* session,
320
                            const char *from, const char *to);
1095.3.29 by Stewart Smith
s/Impl/Implementation/
321
1039.3.12 by Stewart Smith
remove handler::ha_delete_table and have StorageEngine::deleteTable instead
322
1039.3.9 by Stewart Smith
beat identifiers with an ugly stick (otherwise known as "coding standards" and s/create_table/createTable/)
323
public:
1039.3.8 by Stewart Smith
Re-introduce marking transaction as read-write for engine on create_table:
324
1109.1.1 by Brian Aker
Applying refactor of tmp table bits back to session. (this all needs to be
325
  int renameTable(Session *session, const char *from, const char *to) 
326
  {
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
327
    setTransactionReadWrite(*session);
1039.3.5 by Stewart Smith
move handler::rename_table to StorageEngine
328
1183.1.7 by Brian Aker
Fix name conventions for rename table
329
    return doRenameTable(session, from, to);
1039.3.10 by Stewart Smith
move ha_rename_table to just be StorageEngine::renameTable with engines implementing renameTableImpl.
330
  }
1039.3.3 by Stewart Smith
Move handler::create to StorageEngine::create_table
331
1183.1.9 by Brian Aker
Rename deleteTableImpl -> doDeleteTable()
332
  // TODO: move these to protected
1183.1.13 by Brian Aker
Fix pass by reference for directory object
333
  virtual void doGetTableNames(CachedDirectory &directory, std::string& db_name, std::set<std::string>& set_of_names);
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
334
  virtual int doDropTable(Session& session,
1183.1.26 by Brian Aker
Require engines to implement their own doDropTable().
335
                          const std::string table_path)= 0;
1183.1.5 by Brian Aker
Reworked getTableNames() interface. Way simpler, less mallocs....
336
1095.3.14 by Brian Aker
Moved file based flag up to engine (from handler). checkLowercaseNames() is now a ember of StorageEngine.
337
  const char *checkLowercaseNames(const char *path, char *tmp_path);
1095.3.22 by Stewart Smith
Iterate over StorageEngines and use their TableNameIterators before the default DFE Iterator.
338
1160.1.1 by Brian Aker
Refactor SE createTable back to engine class.
339
  /* Class Methods for operating on plugin */
1130.1.19 by Monty Taylor
Added error reporting to plugin registration.
340
  static bool addPlugin(plugin::StorageEngine *engine);
1130.1.18 by Monty Taylor
Changed ::add() and ::remove() to ::addPlugin() and ::removePlugin() so that
341
  static void removePlugin(plugin::StorageEngine *engine);
1130.1.12 by Monty Taylor
Moved service stuff into plugin/
342
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
343
  static int getTableDefinition(Session& session,
344
                                const char* path, 
1183.5.1 by Brian Aker
Extended definition interface (filename building should now be moved
345
                                const char *db,
346
                                const char *table_name,
347
                                const bool is_tmp,
348
                                message::Table *table_proto= NULL);
1130.1.12 by Monty Taylor
Moved service stuff into plugin/
349
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
350
  static plugin::StorageEngine *findByName(std::string find_str);
351
  static plugin::StorageEngine *findByName(Session& session,
1130.1.12 by Monty Taylor
Moved service stuff into plugin/
352
                                           std::string find_str);
353
  static void closeConnection(Session* session);
354
  static void dropDatabase(char* path);
355
  static int commitOrRollbackByXID(XID *xid, bool commit);
356
  static int releaseTemporaryLatches(Session *session);
357
  static bool flushLogs(plugin::StorageEngine *db_type);
358
  static int recover(HASH *commit_list);
359
  static int startConsistentSnapshot(Session *session);
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
360
  static int dropTable(Session& session, const char *path, const char *db,
1183.1.22 by Brian Aker
Merge Name changes
361
                       const char *alias, bool generate_warning);
1183.1.5 by Brian Aker
Reworked getTableNames() interface. Way simpler, less mallocs....
362
  static void getTableNames(std::string& db_name, std::set<std::string> &set_of_names);
363
1130.1.13 by Monty Taylor
Moved some simple methods back into header to they can be inlined. Removed a couple wrapper methods.
364
  static inline const std::string &resolveName(const StorageEngine *engine)
365
  {
366
    return engine == NULL ? UNKNOWN_STRING : engine->getName();
367
  }
1130.1.12 by Monty Taylor
Moved service stuff into plugin/
368
1183.1.29 by Brian Aker
Clean up interface so that Truncate sets the propper engine when
369
  static int createTable(Session& session, const char *path,
1160.1.1 by Brian Aker
Refactor SE createTable back to engine class.
370
                         const char *db, const char *table_name,
1183.1.20 by Brian Aker
Quick pass through ha_create in doTableCreate() to turn it into a reference.
371
                         HA_CREATE_INFO& create_info,
1160.1.1 by Brian Aker
Refactor SE createTable back to engine class.
372
                         bool update_create_info,
1183.1.18 by Brian Aker
Fixed references to doCreateTable()
373
                         drizzled::message::Table& table_proto,
374
                         bool used= true);
1183.1.1 by Brian Aker
Rework interface pieces on SE (sort of... dumb ones...)
375
1213 by Brian Aker
Fixes startup failures when temporary tables were left behind in a crash.
376
  static void removeLostTemporaryTables(Session &session, const char *directory);
377
1208.3.2 by brian
Update for Cursor renaming.
378
  Cursor *getCursor(TableShare &share, MEM_ROOT *alloc);
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
379
};
380
1130.1.4 by Monty Taylor
Moved StorageEngine into plugin namespace.
381
} /* namespace plugin */
382
} /* namespace drizzled */
383
968.2.29 by Monty Taylor
First steps towards new plugin reg.
384
#endif /* DRIZZLED_PLUGIN_STORAGE_ENGINE_H */