28
28
using namespace std;
29
29
using namespace drizzled;
31
static SchemaIdentifier INFORMATION_SCHEMA_IDENTIFIER("INFORMATION_SCHEMA");
32
static SchemaIdentifier DATA_DICTIONARY_IDENTIFIER("DATA_DICTIONARY");
31
34
Function::Function(const std::string &name_arg) :
32
35
drizzled::plugin::StorageEngine(name_arg,
33
36
HTON_ALTER_NOT_SUPPORTED |
67
70
void Function::doGetTableNames(drizzled::CachedDirectory&,
71
drizzled::SchemaIdentifier &schema_identifier,
69
72
set<string> &set_of_names)
71
drizzled::plugin::TableFunction::getNames(db, set_of_names);
74
void Function::doGetSchemaNames(std::set<std::string>& set_of_names)
76
set_of_names.insert("information_schema"); // special cases suck
77
set_of_names.insert("data_dictionary"); // special cases suck
80
bool Function::doGetSchemaDefinition(const std::string &schema_name, message::Schema &schema_message)
82
if (not schema_name.compare("information_schema"))
74
drizzled::plugin::TableFunction::getNames(schema_identifier.getSchemaName(), set_of_names);
77
void Function::doGetSchemaIdentifiers(SchemaIdentifierList& schemas)
79
schemas.push_back(INFORMATION_SCHEMA_IDENTIFIER);
80
schemas.push_back(DATA_DICTIONARY_IDENTIFIER);
83
bool Function::doGetSchemaDefinition(SchemaIdentifier &schema_identifier, message::Schema &schema_message)
85
if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
84
87
schema_message.set_name("information_schema");
85
88
schema_message.set_collation("utf8_general_ci");
87
else if (not schema_name.compare("data_dictionary"))
90
else if (schema_identifier == DATA_DICTIONARY_IDENTIFIER)
89
92
schema_message.set_name("data_dictionary");
90
93
schema_message.set_collation("utf8_general_ci");
100
bool Function::doCanCreateTable(const drizzled::TableIdentifier &identifier)
103
bool Function::doCanCreateTable(drizzled::TableIdentifier &table_identifier)
102
if (not strcasecmp(identifier.getSchemaName().c_str(), "information_schema"))
105
if (static_cast<SchemaIdentifier&>(table_identifier) == INFORMATION_SCHEMA_IDENTIFIER)
107
if (not strcasecmp(identifier.getSchemaName().c_str(), "data_dictionary"))
110
else if (static_cast<SchemaIdentifier&>(table_identifier) == DATA_DICTIONARY_IDENTIFIER)