~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/benchmark/benchmarkudf.cc

  • Committer: Jay Pipes
  • Date: 2009-10-03 06:05:57 UTC
  • mto: (1234.1.1 push) (1237.2.10 push)
  • mto: This revision was merged to the branch mainline in revision 1166.
  • Revision ID: jpipes@serialcoder-20091003060557-kw8xz3p634vqsbsi
New transaction proto file containing message definitions to be
used in new replication system, which supports group commit behaviour.

New statement_transform library files with utility methods used in 
converting transaction messages into SQL strings.

Update transaction_reader and transaction_writer programs to use
CodedOutput and CodedInputStream from GPB library and got rid of 
calls to korr.h macros entirely.

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");
118
117
 
119
118
plugin::Create_function<BenchmarkFunction> *benchmarkudf= NULL;
120
119
 
121
 
static int initialize(plugin::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.function.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.function.remove(benchmarkudf);
 
130
   delete benchmarkudf;
 
131
   return 0;
 
132
}
 
133
 
 
134
drizzle_declare_plugin(benchmark)
 
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;