~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/function_engine/function.cc

LOCK_open to boost.

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
 
 
66
void Function::doGetTableNames(drizzled::CachedDirectory&, 
 
67
                               const drizzled::SchemaIdentifier &schema_identifier,
 
68
                               set<string> &set_of_names)
 
69
{
 
70
  drizzled::plugin::TableFunction::getNames(schema_identifier.getPath(), set_of_names);
 
71
}
 
72
 
 
73
void Function::doGetSchemaIdentifiers(SchemaIdentifiers& 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 SchemaIdentifier &schema_identifier, message::Schema &schema_message)
80
80
{
81
 
  schema_message.reset(new message::Schema); // This should be fixed, we could just be using ones we built on startup.
82
 
 
83
81
  if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
84
82
  {
85
 
    schema_message= information_message;
 
83
    schema_message.set_name("information_schema");
 
84
    schema_message.set_collation("utf8_general_ci");
86
85
  }
87
86
  else if (schema_identifier == DATA_DICTIONARY_IDENTIFIER)
88
87
  {
89
 
    schema_message= data_dictionary_message;
 
88
    schema_message.set_name("data_dictionary");
 
89
    schema_message.set_collation("utf8_general_ci");
90
90
  }
91
91
  else
92
92
  {
124
124
 
125
125
void Function::doGetTableIdentifiers(drizzled::CachedDirectory&,
126
126
                                     const drizzled::SchemaIdentifier &schema_identifier,
127
 
                                     drizzled::TableIdentifier::vector &set_of_identifiers)
 
127
                                     drizzled::TableIdentifiers &set_of_identifiers)
128
128
{
129
 
  set<std::string> set_of_names;
 
129
  set<string> set_of_names;
130
130
  drizzled::plugin::TableFunction::getNames(schema_identifier.getSchemaName(), set_of_names);
131
131
 
132
 
  for (set<std::string>::iterator iter= set_of_names.begin(); iter != set_of_names.end(); iter++)
 
132
  for (set<string>::iterator iter= set_of_names.begin(); iter != set_of_names.end(); iter++)
133
133
  {
134
134
    set_of_identifiers.push_back(TableIdentifier(schema_identifier, *iter, drizzled::message::Table::FUNCTION));
135
135
  }