~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/benchmark/benchmarkudf.cc

Added pandora check for berkeley db.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
18
18
 */
19
19
 
20
 
#include "config.h"
 
20
#include <drizzled/server_includes.h>
21
21
#include <drizzled/error.h>
22
22
#include <drizzled/session.h>
23
 
#include "drizzled/internal/m_string.h"
24
23
 
25
24
using namespace std;
26
25
using namespace drizzled;
68
67
  {
69
68
    if (args[0]->null_value == false)
70
69
    {
71
 
      internal::int64_t10_to_str((int64_t)loop_count, buff, -10);
 
70
      llstr(((int64_t) loop_count), buff);
72
71
      push_warning_printf(current_session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
73
72
                          ER_WRONG_VALUE_FOR_TYPE, ER(ER_WRONG_VALUE_FOR_TYPE),
74
73
                          "count", buff, "benchmark");
81
80
  null_value= false;
82
81
 
83
82
  uint64_t loop;
84
 
  for (loop= 0 ; loop < loop_count && not session->getKilled(); loop++)
 
83
  for (loop= 0 ; loop < loop_count && !session->killed; loop++)
85
84
  {
86
85
    switch (args[1]->result_type()) 
87
86
    {
118
117
 
119
118
plugin::Create_function<BenchmarkFunction> *benchmarkudf= NULL;
120
119
 
121
 
static int initialize(module::Context &context)
 
120
static int initialize(plugin::Registry &registry)
122
121
{
123
122
  benchmarkudf= new plugin::Create_function<BenchmarkFunction>("benchmark");
124
 
  context.add(benchmarkudf);
 
123
  registry.add(benchmarkudf);
125
124
  return 0;
126
125
}
127
126
 
128
 
DRIZZLE_DECLARE_PLUGIN
129
 
{
130
 
  DRIZZLE_VERSION_ID,
 
127
static int finalize(plugin::Registry &registry)
 
128
{
 
129
   registry.remove(benchmarkudf);
 
130
   delete benchmarkudf;
 
131
   return 0;
 
132
}
 
133
 
 
134
drizzle_declare_plugin
 
135
{
131
136
  "benchmark",
132
137
  "1.0",
133
138
  "Devananda van der Veen",
134
139
  "Measure time for repeated calls to a function.",
135
140
  PLUGIN_LICENSE_GPL,
136
141
  initialize, /* Plugin Init */
 
142
  finalize,   /* Plugin Deinit */
 
143
  NULL,   /* status variables */
137
144
  NULL,   /* system variables */
138
145
  NULL    /* config options */
139
146
}
140
 
DRIZZLE_DECLARE_PLUGIN_END;
 
147
drizzle_declare_plugin_end;