00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <drizzled/item/function/boolean.h>
00025 #include <iostream>
00026
00027 namespace drizzled
00028 {
00029
00030 namespace utility_functions
00031 {
00032
00033 class Assert :public drizzled::item::function::Boolean
00034 {
00035 public:
00036 Assert() :
00037 drizzled::item::function::Boolean()
00038 {
00039 }
00040
00041 bool val_bool();
00042
00043 int64_t val_int()
00044 {
00045 return val_bool();
00046 }
00047 const char *func_name() const { return "assert"; }
00048 const char *fully_qualified_func_name() const { return "assert()"; }
00049
00050 void fix_length_and_dec()
00051 {
00052 max_length= 1;
00053 }
00054
00055 bool check_argument_count(int n)
00056 {
00057 return (n == 1);
00058 }
00059 };
00060
00061 }
00062 }
00063