~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

  • Committer: Stewart Smith
  • Date: 2010-04-01 04:50:49 UTC
  • mfrom: (1283.28.35)
  • mto: (1283.38.1)
  • mto: This revision was merged to the branch mainline in revision 1536.
  • Revision ID: stewart@flamingspork.com-20100401045049-ja409wya5jjyw8uy
Merged embedded-innodb-position-rnd-pos into embedded-innodb-autoincrement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <drizzled/message/table.pb.h>
29
29
#include "drizzled/plugin/plugin.h"
30
30
#include "drizzled/sql_string.h"
 
31
#include "drizzled/schema_identifier.h"
31
32
#include "drizzled/table_identifier.h"
32
33
#include "drizzled/cached_directory.h"
33
34
#include "drizzled/plugin/monitored_in_transaction.h"
61
62
  HTON_BIT_TEMPORARY_NOT_SUPPORTED,   // Having temporary tables not supported
62
63
  HTON_BIT_TEMPORARY_ONLY,
63
64
  HTON_BIT_FILE_BASED, // use for check_lowercase_names
64
 
  HTON_BIT_HAS_DATA_DICTIONARY,
65
65
  HTON_BIT_DOES_TRANSACTIONS,
66
66
  HTON_BIT_STATS_RECORDS_IS_EXACT,
67
67
  HTON_BIT_NULL_IN_KEY,
94
94
static const std::bitset<HTON_BIT_SIZE> HTON_TEMPORARY_NOT_SUPPORTED(1 << HTON_BIT_TEMPORARY_NOT_SUPPORTED);
95
95
static const std::bitset<HTON_BIT_SIZE> HTON_TEMPORARY_ONLY(1 << HTON_BIT_TEMPORARY_ONLY);
96
96
static const std::bitset<HTON_BIT_SIZE> HTON_FILE_BASED(1 << HTON_BIT_FILE_BASED);
97
 
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_DATA_DICTIONARY(1 << HTON_BIT_HAS_DATA_DICTIONARY);
98
97
static const std::bitset<HTON_BIT_SIZE> HTON_HAS_DOES_TRANSACTIONS(1 << HTON_BIT_DOES_TRANSACTIONS);
99
98
static const std::bitset<HTON_BIT_SIZE> HTON_STATS_RECORDS_IS_EXACT(1 << HTON_BIT_STATS_RECORDS_IS_EXACT);
100
99
static const std::bitset<HTON_BIT_SIZE> HTON_NULL_IN_KEY(1 << HTON_BIT_NULL_IN_KEY);
129
128
typedef std::vector<StorageEngine *> EngineVector;
130
129
 
131
130
typedef std::set<std::string> TableNameList;
132
 
typedef std::set<std::string> SchemaNameList;
133
131
 
134
132
extern const std::string UNKNOWN_STRING;
135
133
extern const std::string DEFAULT_DEFINITION_FILE_EXT;
152
150
private:
153
151
  const std::bitset<HTON_BIT_SIZE> flags; /* global Cursor flags */
154
152
 
 
153
  static EngineVector &getSchemaEngines();
 
154
 
155
155
  virtual void setTransactionReadWrite(Session& session);
156
156
 
157
157
  /*
282
282
  virtual const char **bas_ext() const =0;
283
283
 
284
284
protected:
285
 
  virtual int doCreateTable(Session *session,
286
 
                            Table& table_arg,
 
285
  virtual int doCreateTable(Session &session,
 
286
                            Table &table_arg,
287
287
                            TableIdentifier &identifier,
288
 
                            message::Table& proto)= 0;
 
288
                            message::Table &message)= 0;
289
289
 
290
290
  virtual int doRenameTable(Session &session,
291
291
                            TableIdentifier &from, TableIdentifier &to)= 0;
296
296
 
297
297
  // @todo move these to protected
298
298
  virtual void doGetTableNames(CachedDirectory &directory,
299
 
                               std::string& db_name,
 
299
                               drizzled::SchemaIdentifier &schema_identifier,
300
300
                               TableNameList &set_of_names);
301
301
 
302
302
  virtual int doDropTable(Session &session,
327
327
  static int dropTable(Session& session,
328
328
                       StorageEngine &engine,
329
329
                       TableIdentifier &identifier);
330
 
  static void getTableNames(const std::string& db_name, TableNameList &set_of_names);
 
330
  static void getTableNames(Session &session, drizzled::SchemaIdentifier& schema_identifier, TableNameList &set_of_names);
331
331
 
332
332
  // Check to see if any SE objects to creation.
333
333
  static bool canCreateTable(drizzled::TableIdentifier &identifier);
334
 
  virtual bool doCanCreateTable(const drizzled::TableIdentifier &identifier)
 
334
  virtual bool doCanCreateTable(drizzled::TableIdentifier &identifier)
335
335
  { (void)identifier;  return true; }
336
336
 
337
337
  // @note All schema methods defined here
338
 
  static void getSchemaNames(SchemaNameList &set_of_names);
 
338
  static void getSchemaIdentifiers(Session &session, SchemaIdentifierList &schemas);
339
339
  static bool getSchemaDefinition(TableIdentifier &identifier, message::Schema &proto);
340
 
  static bool getSchemaDefinition(const std::string &schema_name, message::Schema &proto);
341
 
  static bool doesSchemaExist(const std::string &schema_name);
342
 
  static bool doesSchemaExist(TableIdentifier &identifier);
343
 
  static const CHARSET_INFO *getSchemaCollation(const std::string &schema_name);
 
340
  static bool getSchemaDefinition(drizzled::SchemaIdentifier &identifier, message::Schema &proto);
 
341
  static bool doesSchemaExist(drizzled::SchemaIdentifier &identifier);
 
342
  static const CHARSET_INFO *getSchemaCollation(drizzled::SchemaIdentifier &identifier);
344
343
  static bool createSchema(const drizzled::message::Schema &schema_message);
345
 
  static bool dropSchema(const std::string &schema_name);
 
344
  static bool dropSchema(drizzled::SchemaIdentifier &identifier);
346
345
  static bool alterSchema(const drizzled::message::Schema &schema_message);
347
346
 
348
347
  // @note make private/protected
349
 
  virtual void doGetSchemaNames(SchemaNameList &set_of_names)
350
 
  { (void)set_of_names; }
 
348
  virtual void doGetSchemaIdentifiers(SchemaIdentifierList&)
 
349
  { }
351
350
 
352
 
  virtual bool doGetSchemaDefinition(const std::string &schema_name, drizzled::message::Schema &proto)
 
351
  virtual bool doGetSchemaDefinition(drizzled::SchemaIdentifier&, drizzled::message::Schema&)
353
352
  { 
354
 
    (void)schema_name;
355
 
    (void)proto; 
356
 
 
357
353
    return false; 
358
354
  }
359
355
 
360
 
  virtual bool doCreateSchema(const drizzled::message::Schema &schema_message)
361
 
  { (void)schema_message; return false; }
362
 
 
363
 
  virtual bool doAlterSchema(const drizzled::message::Schema &schema_message)
364
 
  { (void)schema_message; return false; }
365
 
 
366
 
  virtual bool doDropSchema(const std::string &schema_name)
367
 
  { (void)schema_name; return false; }
 
356
  virtual bool doCreateSchema(const drizzled::message::Schema&)
 
357
  { return false; }
 
358
 
 
359
  virtual bool doAlterSchema(const drizzled::message::Schema&)
 
360
  { return false; }
 
361
 
 
362
  virtual bool doDropSchema(drizzled::SchemaIdentifier&)
 
363
  { return false; }
368
364
 
369
365
  static inline const std::string &resolveName(const StorageEngine *engine)
370
366
  {