~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

edit

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#define DRIZZLED_PLUGIN_STORAGE_ENGINE_H
22
22
 
23
23
 
24
 
#include <drizzled/cached_directory.h>
25
24
#include <drizzled/definitions.h>
26
 
#include <drizzled/error_t.h>
 
25
#include <drizzled/plugin.h>
27
26
#include <drizzled/handler_structs.h>
28
 
#include <drizzled/identifier.h>
29
27
#include <drizzled/message.h>
30
28
#include <drizzled/message/cache.h>
31
 
#include <drizzled/plugin.h>
32
 
#include <drizzled/plugin/monitored_in_transaction.h>
33
 
#include <drizzled/plugin/plugin.h>
34
 
#include <drizzled/sql_string.h>
 
29
#include "drizzled/plugin/plugin.h"
 
30
#include "drizzled/sql_string.h"
 
31
#include "drizzled/identifier.h"
 
32
#include "drizzled/cached_directory.h"
 
33
#include "drizzled/plugin/monitored_in_transaction.h"
 
34
 
 
35
#include <drizzled/error_t.h>
35
36
 
36
37
#include <bitset>
37
38
#include <string>
38
39
#include <vector>
39
40
#include <set>
40
41
 
41
 
#include <drizzled/visibility.h>
42
 
 
43
42
namespace drizzled
44
43
{
45
44
 
124
123
typedef std::set<std::string> TableNameList;
125
124
 
126
125
extern const std::string UNKNOWN_STRING;
127
 
extern DRIZZLED_API const std::string DEFAULT_DEFINITION_FILE_EXT;
 
126
extern const std::string DEFAULT_DEFINITION_FILE_EXT;
128
127
 
129
128
 
130
129
/*
136
135
 
137
136
  static StorageEngine { ... } xxx_engine;
138
137
*/
139
 
class DRIZZLED_API StorageEngine :
140
 
  public Plugin,
141
 
  public MonitoredInTransaction
 
138
class StorageEngine : public Plugin,
 
139
                      public MonitoredInTransaction
142
140
{
143
141
  friend class SEAPITester;
144
142
public:
222
220
  }
223
221
 
224
222
  /* Old style cursor errors */
225
 
  void print_keydup_error(uint32_t key_nr, const char *msg, const Table &table) const;
226
 
  virtual bool get_error_message(int error, String *buf) const;
 
223
  void print_keydup_error(uint32_t key_nr, const char *msg, Table &table);
 
224
  virtual bool get_error_message(int error, String *buf);
227
225
 
228
226
public:
229
 
  virtual void print_error(int error, myf errflag, const Table& table) const;
 
227
  virtual void print_error(int error, myf errflag, Table& table);
230
228
 
231
229
  bool is_user_selectable() const
232
230
  {
323
321
  static bool addPlugin(plugin::StorageEngine *engine);
324
322
  static void removePlugin(plugin::StorageEngine *engine);
325
323
 
 
324
  static int getTableDefinition(Session& session,
 
325
                                const drizzled::identifier::Table &identifier,
 
326
                                message::table::shared_ptr &table_proto,
 
327
                                bool include_temporary_tables= true);
326
328
  static message::table::shared_ptr getTableMessage(Session& session,
327
329
                                                    const drizzled::identifier::Table &identifier,
 
330
                                                    drizzled::error_t &error,
328
331
                                                    bool include_temporary_tables= true);
329
332
  static bool doesTableExist(Session &session,
330
333
                             const drizzled::identifier::Table &identifier,
357
360
 
358
361
  // @note All schema methods defined here
359
362
  static void getIdentifiers(Session &session, identifier::Schema::vector &schemas);
360
 
  static message::schema::shared_ptr getSchemaDefinition(const drizzled::identifier::Table &identifier);
361
 
  static message::schema::shared_ptr getSchemaDefinition(const drizzled::identifier::Schema &identifier);
 
363
  static bool getSchemaDefinition(const drizzled::identifier::Table &identifier, message::schema::shared_ptr &proto);
 
364
  static bool getSchemaDefinition(const drizzled::identifier::Schema &identifier, message::schema::shared_ptr &proto);
362
365
  static bool doesSchemaExist(const drizzled::identifier::Schema &identifier);
363
366
  static const CHARSET_INFO *getSchemaCollation(const drizzled::identifier::Schema &identifier);
364
367
  static bool createSchema(const drizzled::message::Schema &schema_message);
365
 
  static bool dropSchema(Session &session,
366
 
                         identifier::Schema::const_reference identifier,
367
 
                         message::schema::const_reference schema_message);
 
368
  static bool dropSchema(drizzled::Session& session, identifier::Schema::const_reference identifier);
368
369
  static bool alterSchema(const drizzled::message::Schema &schema_message);
369
370
 
370
371
  // @note make private/protected
372
373
  virtual void doGetSchemaIdentifiers(identifier::Schema::vector&)
373
374
  { }
374
375
 
375
 
  virtual drizzled::message::schema::shared_ptr doGetSchemaDefinition(const drizzled::identifier::Schema&)
 
376
  virtual bool doGetSchemaDefinition(const drizzled::identifier::Schema&, drizzled::message::schema::shared_ptr&)
376
377
  { 
377
 
    return drizzled::message::schema::shared_ptr(); 
 
378
    return false; 
378
379
  }
379
380
 
380
381
  virtual bool doCreateSchema(const drizzled::message::Schema&)
401
402
  Cursor *getCursor(Table &share);
402
403
 
403
404
  uint32_t max_record_length() const
404
 
  { return std::min(HA_MAX_REC_LENGTH, max_supported_record_length()); }
 
405
  { return std::min((unsigned int)HA_MAX_REC_LENGTH, max_supported_record_length()); }
405
406
  uint32_t max_keys() const
406
 
  { return std::min(MAX_KEY, max_supported_keys()); }
 
407
  { return std::min((unsigned int)MAX_KEY, max_supported_keys()); }
407
408
  uint32_t max_key_parts() const
408
 
  { return std::min(MAX_REF_PARTS, max_supported_key_parts()); }
 
409
  { return std::min((unsigned int)MAX_REF_PARTS, max_supported_key_parts()); }
409
410
  uint32_t max_key_length() const
410
 
  { return std::min(MAX_KEY_LENGTH, max_supported_key_length()); }
 
411
  { return std::min((unsigned int)MAX_KEY_LENGTH, max_supported_key_length()); }
411
412
  uint32_t max_key_part_length(void) const
412
 
  { return std::min(MAX_KEY_LENGTH, max_supported_key_part_length()); }
 
413
  { return std::min((unsigned int)MAX_KEY_LENGTH, max_supported_key_part_length()); }
413
414
 
414
415
  virtual uint32_t max_supported_record_length(void) const
415
416
  { return HA_MAX_REC_LENGTH; }