~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/benchmark/benchmarkudf.cc

  • Committer: devananda
  • Date: 2009-07-09 20:48:37 UTC
  • mto: (1093.1.7 captain)
  • mto: This revision was merged to the branch mainline in revision 1095.
  • Revision ID: devananda.vdv@gmail.com-20090709204837-3qg12i8hp0iv2vbx
formatting cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
  const char *func_name() const
34
34
  { 
35
 
     return "benchmark"; 
 
35
    return "benchmark"; 
36
36
  }
37
37
 
38
38
  void fix_length_and_dec()
39
39
  { 
40
 
     max_length=1; 
41
 
     maybe_null=0;
 
40
    max_length= 1; 
 
41
    maybe_null= false;
42
42
  }
43
43
 
44
44
  bool check_argument_count(int n)
45
45
  { 
46
 
     return (n==2); 
 
46
    return (n == 2); 
47
47
  }
48
48
};
49
49
 
51
51
/* This function is just used to test speed of different functions */
52
52
int64_t BenchmarkFunction::val_int()
53
53
{
54
 
  assert(fixed == 1);
 
54
  assert(fixed == true);
 
55
 
55
56
  char buff[MAX_FIELD_WIDTH];
56
57
  String tmp(buff,sizeof(buff), &my_charset_bin);
57
58
  my_decimal tmp_decimal;
71
72
                          "count", buff, "benchmark");
72
73
    }
73
74
 
74
 
    null_value= 1;
 
75
    null_value= true;
75
76
    return 0;
76
77
  }
77
78
 
78
 
  null_value= 0;
79
 
 
 
79
  null_value= false;
80
80
 
81
81
  uint64_t loop;
82
82
  for (loop= 0 ; loop < loop_count && !session->killed; loop++)
131
131
drizzle_declare_plugin(benchmark)
132
132
{
133
133
  "benchmark",
134
 
  "0.1",
 
134
  "1.0",
135
135
  "Devananda van der Veen",
136
136
  "Measure time for repeated calls to a function.",
137
137
  PLUGIN_LICENSE_GPL,