~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/function_engine/function.cc

  • Committer: tdavies
  • Date: 2010-10-05 03:25:08 UTC
  • mto: (1816.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1817.
  • Revision ID: tdavies@molly-20101005032508-pd1cg5nmxziov9wv
change in file: ../drizzled/base.h. Converted C structs key_range and KEY_MULTI_RANGE to C++ classes

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                                  HTON_ALTER_NOT_SUPPORTED |
37
37
                                  HTON_HAS_SCHEMA_DICTIONARY |
38
38
                                  HTON_SKIP_STORE_LOCK |
39
 
                                  HTON_TEMPORARY_NOT_SUPPORTED),
40
 
  information_message(new(message::Schema)),
41
 
  data_dictionary_message(new(message::Schema))
42
 
 
 
39
                                  HTON_TEMPORARY_NOT_SUPPORTED)
43
40
{
44
 
  information_message->set_name("information_schema");
45
 
  data_dictionary_message->set_collation("utf8_general_ci");
46
 
 
47
 
  data_dictionary_message->set_name("data_dictionary");
48
 
  data_dictionary_message->set_collation("utf8_general_ci");
49
41
}
50
42
 
51
43
 
52
 
Cursor *Function::create(Table &table)
 
44
Cursor *Function::create(TableShare &table)
53
45
{
54
46
  return new FunctionCursor(*this, table);
55
47
}
70
62
  return EEXIST;
71
63
}
72
64
 
73
 
void Function::doGetSchemaIdentifiers(SchemaIdentifier::vector& schemas)
 
65
void Function::doGetSchemaIdentifiers(SchemaIdentifiers& schemas)
74
66
{
75
67
  schemas.push_back(INFORMATION_SCHEMA_IDENTIFIER);
76
68
  schemas.push_back(DATA_DICTIONARY_IDENTIFIER);
77
69
}
78
70
 
79
 
bool Function::doGetSchemaDefinition(const SchemaIdentifier &schema_identifier, message::schema::shared_ptr &schema_message)
 
71
bool Function::doGetSchemaDefinition(const SchemaIdentifier &schema_identifier, message::Schema &schema_message)
80
72
{
81
 
  schema_message.reset(new message::Schema); // This should be fixed, we could just be using ones we built on startup.
82
 
 
83
73
  if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
84
74
  {
85
 
    schema_message= information_message;
 
75
    schema_message.set_name("information_schema");
 
76
    schema_message.set_collation("utf8_general_ci");
86
77
  }
87
78
  else if (schema_identifier == DATA_DICTIONARY_IDENTIFIER)
88
79
  {
89
 
    schema_message= data_dictionary_message;
 
80
    schema_message.set_name("data_dictionary");
 
81
    schema_message.set_collation("utf8_general_ci");
90
82
  }
91
83
  else
92
84
  {
124
116
 
125
117
void Function::doGetTableIdentifiers(drizzled::CachedDirectory&,
126
118
                                     const drizzled::SchemaIdentifier &schema_identifier,
127
 
                                     drizzled::TableIdentifier::vector &set_of_identifiers)
 
119
                                     drizzled::TableIdentifiers &set_of_identifiers)
128
120
{
129
 
  set<std::string> set_of_names;
 
121
  set<string> set_of_names;
130
122
  drizzled::plugin::TableFunction::getNames(schema_identifier.getSchemaName(), set_of_names);
131
123
 
132
 
  for (set<std::string>::iterator iter= set_of_names.begin(); iter != set_of_names.end(); iter++)
 
124
  for (set<string>::iterator iter= set_of_names.begin(); iter != set_of_names.end(); iter++)
133
125
  {
134
126
    set_of_identifiers.push_back(TableIdentifier(schema_identifier, *iter, drizzled::message::Table::FUNCTION));
135
127
  }