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);
282
282
virtual const char **bas_ext() const =0;
285
virtual int doCreateTable(Session *session,
285
virtual int doCreateTable(Session &session,
287
287
TableIdentifier &identifier,
288
message::Table& proto)= 0;
288
message::Table &message)= 0;
290
290
virtual int doRenameTable(Session &session,
291
291
TableIdentifier &from, TableIdentifier &to)= 0;
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);
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);
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; }
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);
348
347
// @note make private/protected
349
virtual void doGetSchemaNames(SchemaNameList &set_of_names)
350
{ (void)set_of_names; }
348
virtual void doGetSchemaIdentifiers(SchemaIdentifierList&)
352
virtual bool doGetSchemaDefinition(const std::string &schema_name, drizzled::message::Schema &proto)
351
virtual bool doGetSchemaDefinition(drizzled::SchemaIdentifier&, drizzled::message::Schema&)
360
virtual bool doCreateSchema(const drizzled::message::Schema &schema_message)
361
{ (void)schema_message; return false; }
363
virtual bool doAlterSchema(const drizzled::message::Schema &schema_message)
364
{ (void)schema_message; return false; }
366
virtual bool doDropSchema(const std::string &schema_name)
367
{ (void)schema_name; return false; }
356
virtual bool doCreateSchema(const drizzled::message::Schema&)
359
virtual bool doAlterSchema(const drizzled::message::Schema&)
362
virtual bool doDropSchema(drizzled::SchemaIdentifier&)
369
365
static inline const std::string &resolveName(const StorageEngine *engine)