~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/debug/module.cc

  • Committer: Brian Aker
  • Date: 2010-12-19 06:20:54 UTC
  • mfrom: (2005.1.1 bug673105)
  • Revision ID: brian@tangent.org-20101219062054-1kt0l3dxs4z2z8md
Merge Dave.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
#include <signal.h>
40
40
 
 
41
#include <drizzled/util/backtrace.h>
41
42
#include <drizzled/function/func.h>
42
43
#include <drizzled/item/cmpfunc.h>
43
 
#include <drizzled/item/function/boolean.h>
44
 
#include <drizzled/plugin/function.h>
45
 
#include <drizzled/util/backtrace.h>
46
44
 
47
45
using namespace drizzled;
48
46
 
49
47
namespace debug {
50
48
 
51
 
class Assert :public item::function::Boolean
 
49
class Assert :public Item_bool_func
52
50
{
53
51
public:
54
52
  Assert() :
55
 
    item::function::Boolean()
 
53
    Item_bool_func()
56
54
  {
57
55
    unsigned_flag= true;
58
56
  }
59
57
 
60
 
  const char *func_name() const { return "assert_and_crash"; }
61
 
  const char *fully_qualified_func_name() const { return "assert_and_crash()"; }
 
58
  const char *func_name() const { return "assert"; }
 
59
  const char *fully_qualified_func_name() const { return "assert()"; }
62
60
 
63
61
  bool val_bool()
64
62
  {
65
 
    String _res;
66
 
    String *res= args[0]->val_str(&_res);
 
63
    drizzled::String _res;
 
64
    drizzled::String *res= args[0]->val_str(&_res);
67
65
 
68
66
    null_value= false;
69
67
 
87
85
  }
88
86
};
89
87
 
90
 
class Backtrace :public item::function::Boolean
 
88
class Backtrace :public Item_bool_func
91
89
{
92
90
public:
93
91
  Backtrace() :
94
 
    item::function::Boolean()
 
92
    Item_bool_func()
95
93
  {
96
94
    unsigned_flag= true;
97
95
  }
101
99
 
102
100
  bool val_bool()
103
101
  {
104
 
    util::custom_backtrace();
 
102
    drizzled::util::custom_backtrace();
105
103
    return true;
106
104
  }
107
105
 
111
109
  }
112
110
};
113
111
 
114
 
class Crash :public item::function::Boolean
 
112
class Crash :public Item_bool_func
115
113
{
116
114
public:
117
115
  Crash() :
118
 
    item::function::Boolean()
 
116
    Item_bool_func()
119
117
  { }
120
118
 
121
119
  const char *func_name() const { return "crash"; }
138
136
 
139
137
static int initialize(drizzled::module::Context &context)
140
138
{
141
 
  context.add(new drizzled::plugin::Create_function<debug::Assert>("assert_and_crash"));
 
139
  context.add(new drizzled::plugin::Create_function<debug::Assert>("assert"));
142
140
  context.add(new drizzled::plugin::Create_function<debug::Backtrace>("backtrace"));
143
141
  context.add(new drizzled::plugin::Create_function<debug::Crash>("crash"));
144
142
 
154
152
  "Useful functions for programmers to debug the server.",
155
153
  PLUGIN_LICENSE_BSD,
156
154
  initialize, /* Plugin Init */
157
 
  NULL,   /* depends */
 
155
  NULL,   /* system variables */
158
156
  NULL    /* config options */
159
157
}
160
158
DRIZZLE_DECLARE_PLUGIN_END;