~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/debug/module.cc

fixed build warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <drizzled/util/backtrace.h>
42
42
#include <drizzled/function/func.h>
43
43
#include <drizzled/item/cmpfunc.h>
 
44
#include <drizzled/item/function/boolean.h>
44
45
 
45
46
using namespace drizzled;
46
47
 
47
48
namespace debug {
48
49
 
49
 
class Assert :public Item_bool_func
 
50
class Assert :public item::function::Boolean
50
51
{
51
52
public:
52
53
  Assert() :
53
 
    Item_bool_func()
 
54
    item::function::Boolean()
54
55
  {
55
56
    unsigned_flag= true;
56
57
  }
57
58
 
58
 
  const char *func_name() const { return "assert"; }
59
 
  const char *fully_qualified_func_name() const { return "assert()"; }
 
59
  const char *func_name() const { return "assert_and_crash"; }
 
60
  const char *fully_qualified_func_name() const { return "assert_and_crash()"; }
60
61
 
61
62
  bool val_bool()
62
63
  {
63
 
    drizzled::String _res;
64
 
    drizzled::String *res= args[0]->val_str(&_res);
 
64
    String _res;
 
65
    String *res= args[0]->val_str(&_res);
65
66
 
66
67
    null_value= false;
67
68
 
85
86
  }
86
87
};
87
88
 
88
 
class Backtrace :public Item_bool_func
 
89
class Backtrace :public item::function::Boolean
89
90
{
90
91
public:
91
92
  Backtrace() :
92
 
    Item_bool_func()
 
93
    item::function::Boolean()
93
94
  {
94
95
    unsigned_flag= true;
95
96
  }
99
100
 
100
101
  bool val_bool()
101
102
  {
102
 
    drizzled::util::custom_backtrace();
 
103
    util::custom_backtrace();
103
104
    return true;
104
105
  }
105
106
 
109
110
  }
110
111
};
111
112
 
112
 
class Crash :public Item_bool_func
 
113
class Crash :public item::function::Boolean
113
114
{
114
115
public:
115
116
  Crash() :
116
 
    Item_bool_func()
 
117
    item::function::Boolean()
117
118
  { }
118
119
 
119
120
  const char *func_name() const { return "crash"; }
136
137
 
137
138
static int initialize(drizzled::module::Context &context)
138
139
{
139
 
  context.add(new drizzled::plugin::Create_function<debug::Assert>("assert"));
 
140
  context.add(new drizzled::plugin::Create_function<debug::Assert>("assert_and_crash"));
140
141
  context.add(new drizzled::plugin::Create_function<debug::Backtrace>("backtrace"));
141
142
  context.add(new drizzled::plugin::Create_function<debug::Crash>("crash"));
142
143