~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/benchmark/benchmarkudf.cc

  • Committer: Stewart Smith
  • Date: 2010-02-15 01:56:32 UTC
  • mto: (1273.13.96 build)
  • mto: This revision was merged to the branch mainline in revision 1308.
  • Revision ID: stewart@flamingspork.com-20100215015632-pm7lnxfq5j5uh8kj
move DATABASE() to function plugin. modify parser so that it looks for a function named 'database' when DATABASE() is called. Special case still needed in parser due to hilarity of not-really-reserved words.

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
 
119
119
plugin::Create_function<BenchmarkFunction> *benchmarkudf= NULL;
120
120
 
121
 
static int initialize(plugin::Context &context)
 
121
static int initialize(plugin::Registry &registry)
122
122
{
123
123
  benchmarkudf= new plugin::Create_function<BenchmarkFunction>("benchmark");
124
 
  context.add(benchmarkudf);
 
124
  registry.add(benchmarkudf);
125
125
  return 0;
126
126
}
127
127
 
 
128
static int finalize(plugin::Registry &registry)
 
129
{
 
130
   registry.remove(benchmarkudf);
 
131
   delete benchmarkudf;
 
132
   return 0;
 
133
}
 
134
 
128
135
DRIZZLE_DECLARE_PLUGIN
129
136
{
130
137
  DRIZZLE_VERSION_ID,
134
141
  "Measure time for repeated calls to a function.",
135
142
  PLUGIN_LICENSE_GPL,
136
143
  initialize, /* Plugin Init */
 
144
  finalize,   /* Plugin Deinit */
 
145
  NULL,   /* status variables */
137
146
  NULL,   /* system variables */
138
147
  NULL    /* config options */
139
148
}