~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 18:38:57 UTC
  • mto: This revision was merged to the branch mainline in revision 2090.
  • Revision ID: brian@tangent.org-20110117183857-6159ofmvjb2vqgkm
Merge in disable test suite for hail (Monty, Brian, Lee, confirmed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
21
 
#include <config.h>
 
21
#include "config.h"
22
22
 
23
23
#include <plugin/function_engine/function.h>
24
24
#include <plugin/function_engine/cursor.h>
28
28
using namespace std;
29
29
using namespace drizzled;
30
30
 
 
31
static identifier::Schema INFORMATION_SCHEMA_IDENTIFIER("INFORMATION_SCHEMA");
 
32
static identifier::Schema DATA_DICTIONARY_IDENTIFIER("DATA_DICTIONARY");
 
33
 
31
34
Function::Function(const std::string &name_arg) :
32
35
  drizzled::plugin::StorageEngine(name_arg,
33
36
                                  HTON_ALTER_NOT_SUPPORTED |
38
41
  data_dictionary_message(new(message::Schema))
39
42
 
40
43
{
41
 
  information_message->set_name(INFORMATION_SCHEMA_IDENTIFIER.getSchemaName());
42
 
  information_message->set_collation("utf8_general_ci");
43
 
  information_message->mutable_replication_options()->set_dont_replicate(true);
 
44
  information_message->set_name("information_schema");
 
45
  data_dictionary_message->set_collation("utf8_general_ci");
44
46
 
45
 
  data_dictionary_message->set_name(DATA_DICTIONARY_IDENTIFIER.getSchemaName());
 
47
  data_dictionary_message->set_name("data_dictionary");
46
48
  data_dictionary_message->set_collation("utf8_general_ci");
47
 
  data_dictionary_message->mutable_replication_options()->set_dont_replicate(true);
48
49
}
49
50
 
50
51
 
75
76
  schemas.push_back(DATA_DICTIONARY_IDENTIFIER);
76
77
}
77
78
 
78
 
drizzled::message::schema::shared_ptr Function::doGetSchemaDefinition(const identifier::Schema &schema_identifier)
 
79
bool Function::doGetSchemaDefinition(const identifier::Schema &schema_identifier, message::schema::shared_ptr &schema_message)
79
80
{
80
 
  drizzled::message::schema::shared_ptr schema_message;
 
81
  schema_message.reset(new message::Schema); // This should be fixed, we could just be using ones we built on startup.
81
82
 
82
83
  if (schema_identifier == INFORMATION_SCHEMA_IDENTIFIER)
83
84
  {
89
90
  }
90
91
  else
91
92
  {
92
 
    return drizzled::message::schema::shared_ptr();
 
93
    return false;
93
94
  }
94
95
 
95
 
  return schema_message;
 
96
  return true;
96
97
}
97
98
 
98
99
bool Function::doCanCreateTable(const drizzled::identifier::Table &table_identifier)
150
151
  "Function Engine provides the infrastructure for Table Functions,etc.",
151
152
  PLUGIN_LICENSE_GPL,
152
153
  init,     /* Plugin Init */
153
 
  NULL,               /* depends */
 
154
  NULL,               /* system variables */
154
155
  NULL                /* config options   */
155
156
}
156
157
DRIZZLE_DECLARE_PLUGIN_END;