~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/function_engine/function.cc

  • Committer: Brian Aker
  • Date: 2011-01-17 23:44:48 UTC
  • mfrom: (2088.1.5 drizzle-build)
  • Revision ID: brian@tangent.org-20110117234448-0tt6rd6fxa3csdaf
Rollup of all changes for identifier/error

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
using namespace std;
29
29
using namespace drizzled;
30
30
 
31
 
static SchemaIdentifier INFORMATION_SCHEMA_IDENTIFIER("INFORMATION_SCHEMA");
32
 
static SchemaIdentifier DATA_DICTIONARY_IDENTIFIER("DATA_DICTIONARY");
 
31
static identifier::Schema INFORMATION_SCHEMA_IDENTIFIER("INFORMATION_SCHEMA");
 
32
static identifier::Schema DATA_DICTIONARY_IDENTIFIER("DATA_DICTIONARY");
33
33
 
34
34
Function::Function(const std::string &name_arg) :
35
35
  drizzled::plugin::StorageEngine(name_arg,
55
55
}
56
56
 
57
57
int Function::doGetTableDefinition(Session &,
58
 
                                   const TableIdentifier &identifier,
 
58
                                   const identifier::Table &identifier,
59
59
                                   message::Table &table_proto)
60
60
{
61
61
  drizzled::plugin::TableFunction *function= getFunction(identifier.getPath());
70
70
  return EEXIST;
71
71
}
72
72
 
73
 
void Function::doGetSchemaIdentifiers(SchemaIdentifier::vector& schemas)
 
73
void Function::doGetSchemaIdentifiers(identifier::Schema::vector& schemas)
74
74
{
75
75
  schemas.push_back(INFORMATION_SCHEMA_IDENTIFIER);
76
76
  schemas.push_back(DATA_DICTIONARY_IDENTIFIER);
77
77
}
78
78
 
79
 
bool Function::doGetSchemaDefinition(const SchemaIdentifier &schema_identifier, message::schema::shared_ptr &schema_message)
 
79
bool Function::doGetSchemaDefinition(const identifier::Schema &schema_identifier, message::schema::shared_ptr &schema_message)
80
80
{
81
81
  schema_message.reset(new message::Schema); // This should be fixed, we could just be using ones we built on startup.
82
82
 
96
96
  return true;
97
97
}
98
98
 
99
 
bool Function::doCanCreateTable(const drizzled::TableIdentifier &table_identifier)
 
99
bool Function::doCanCreateTable(const drizzled::identifier::Table &table_identifier)
100
100
{
101
 
  if (static_cast<const SchemaIdentifier&>(table_identifier) == INFORMATION_SCHEMA_IDENTIFIER)
 
101
  if (static_cast<const identifier::Schema&>(table_identifier) == INFORMATION_SCHEMA_IDENTIFIER)
102
102
  {
103
103
    return false;
104
104
  }
105
105
 
106
 
  else if (static_cast<const SchemaIdentifier&>(table_identifier) == DATA_DICTIONARY_IDENTIFIER)
 
106
  else if (static_cast<const identifier::Schema&>(table_identifier) == DATA_DICTIONARY_IDENTIFIER)
107
107
  {
108
108
    return false;
109
109
  }
111
111
  return true;
112
112
}
113
113
 
114
 
bool Function::doDoesTableExist(Session&, const TableIdentifier &identifier)
 
114
bool Function::doDoesTableExist(Session&, const identifier::Table &identifier)
115
115
{
116
116
  drizzled::plugin::TableFunction *function= getFunction(identifier.getPath());
117
117
 
123
123
 
124
124
 
125
125
void Function::doGetTableIdentifiers(drizzled::CachedDirectory&,
126
 
                                     const drizzled::SchemaIdentifier &schema_identifier,
127
 
                                     drizzled::TableIdentifier::vector &set_of_identifiers)
 
126
                                     const drizzled::identifier::Schema &schema_identifier,
 
127
                                     drizzled::identifier::Table::vector &set_of_identifiers)
128
128
{
129
129
  set<std::string> set_of_names;
130
130
  drizzled::plugin::TableFunction::getNames(schema_identifier.getSchemaName(), set_of_names);
131
131
 
132
132
  for (set<std::string>::iterator iter= set_of_names.begin(); iter != set_of_names.end(); iter++)
133
133
  {
134
 
    set_of_identifiers.push_back(TableIdentifier(schema_identifier, *iter, drizzled::message::Table::FUNCTION));
 
134
    set_of_identifiers.push_back(identifier::Table(schema_identifier, *iter, drizzled::message::Table::FUNCTION));
135
135
  }
136
136
}
137
137