~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#pragma once
21
21
 
22
 
 
23
 
#include <drizzled/cached_directory.h>
24
22
#include <drizzled/definitions.h>
25
23
#include <drizzled/error_t.h>
26
24
#include <drizzled/handler_structs.h>
27
 
#include <drizzled/identifier.h>
28
25
#include <drizzled/message.h>
29
26
#include <drizzled/message/cache.h>
30
27
#include <drizzled/plugin.h>
39
36
 
40
37
#include <drizzled/visibility.h>
41
38
 
42
 
namespace drizzled
43
 
{
 
39
namespace drizzled {
44
40
 
45
 
class TableList;
46
 
class Session;
47
 
class Cursor;
48
41
struct HASH;
49
42
 
50
 
class TableShare;
51
43
typedef bool (stat_print_fn)(Session *session, const char *type, uint32_t type_len,
52
44
                             const char *file, uint32_t file_len,
53
45
                             const char *status, uint32_t status_len);
112
104
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_FOREIGN_KEYS(1 << HTON_BIT_FOREIGN_KEYS);
113
105
 
114
106
 
115
 
class Table;
116
 
class NamedSavepoint;
117
 
 
118
 
namespace plugin
119
 
{
 
107
namespace plugin {
120
108
 
121
109
typedef std::vector<StorageEngine *> EngineVector;
122
110
 
178
166
    return table_definition_ext;
179
167
  }
180
168
 
 
169
  virtual message::Table::Index::IndexType default_index_type() const
 
170
  {
 
171
    return message::Table::Index::BTREE;
 
172
  }
 
173
 
181
174
private:
182
175
  std::vector<std::string> aliases;
183
176
 
203
196
  pthread_mutex_t proto_cache_mutex;
204
197
 
205
198
public:
206
 
  StorageEngine(const std::string name_arg,
 
199
  StorageEngine(const std::string &name_arg,
207
200
                const std::bitset<HTON_BIT_SIZE> &flags_arg= HTON_NO_FLAGS);
208
201
 
209
202
  virtual ~StorageEngine();
291
284
 
292
285
  virtual void doGetTableIdentifiers(CachedDirectory &directory,
293
286
                                     const drizzled::identifier::Schema &schema_identifier,
294
 
                                     identifier::Table::vector &set_of_identifiers)= 0;
 
287
                                     identifier::table::vector &set_of_identifiers)= 0;
295
288
 
296
289
  virtual bool doDoesTableExist(Session& session, const drizzled::identifier::Table &identifier);
297
290
 
332
325
  static plugin::StorageEngine *findByName(const std::string &find_str);
333
326
  static plugin::StorageEngine *findByName(Session& session, const std::string &find_str);
334
327
 
335
 
  static void closeConnection(Session* session);
 
328
  static void closeConnection(Session&);
336
329
  static void dropDatabase(char* path);
337
330
  static bool flushLogs(plugin::StorageEngine *db_type);
338
331
 
344
337
 
345
338
  static bool dropTable(Session& session,
346
339
                        StorageEngine &engine,
347
 
                        identifier::Table::const_reference identifier,
 
340
                        const identifier::Table& identifier,
348
341
                        drizzled::error_t &error);
349
342
 
350
343
  static void getIdentifiers(Session &session,
351
344
                             const identifier::Schema &schema_identifier,
352
 
                             identifier::Table::vector &set_of_identifiers);
 
345
                             identifier::table::vector &set_of_identifiers);
353
346
 
354
347
  // Check to see if any SE objects to creation.
355
348
  static bool canCreateTable(const drizzled::identifier::Table &identifier);
356
349
 
357
350
  // @note All schema methods defined here
358
 
  static void getIdentifiers(Session &session, identifier::Schema::vector &schemas);
 
351
  static void getIdentifiers(Session &session, identifier::schema::vector &schemas);
359
352
  static message::schema::shared_ptr getSchemaDefinition(const drizzled::identifier::Table &identifier);
360
353
  static message::schema::shared_ptr getSchemaDefinition(const drizzled::identifier::Schema &identifier);
361
354
  static bool doesSchemaExist(const drizzled::identifier::Schema &identifier);
362
 
  static const CHARSET_INFO *getSchemaCollation(const drizzled::identifier::Schema &identifier);
 
355
  static const charset_info_st *getSchemaCollation(const drizzled::identifier::Schema &identifier);
363
356
  static bool createSchema(const drizzled::message::Schema &schema_message);
364
357
  static bool dropSchema(Session &session,
365
 
                         identifier::Schema::const_reference identifier,
 
358
                         const identifier::Schema& identifier,
366
359
                         message::schema::const_reference schema_message);
367
360
  static bool alterSchema(const drizzled::message::Schema &schema_message);
368
361
 
369
362
  // @note make private/protected
370
363
protected:
371
 
  virtual void doGetSchemaIdentifiers(identifier::Schema::vector&)
 
364
  virtual void doGetSchemaIdentifiers(identifier::schema::vector&)
372
365
  { }
373
366
 
374
367
  virtual drizzled::message::schema::shared_ptr doGetSchemaDefinition(const drizzled::identifier::Schema&)