18
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef DRIZZLED_FIELD_NULL_H
22
#define DRIZZLED_FIELD_NULL_H
21
#ifndef DRIZZLE_SERVER_FIELD_NULL
22
#define DRIZZLE_SERVER_FIELD_NULL
24
24
#include <drizzled/field/str.h>
30
27
* Everything saved in this will disappear. It will always return NULL
33
class Field_null :public Field_str
30
class Field_null :public Field_str {
35
31
static unsigned char null[1];
43
Field_null(unsigned char *ptr_arg,
45
const char *field_name_arg,
46
const CHARSET_INFO * const cs)
54
enum_field_types type() const
56
return DRIZZLE_TYPE_NULL;
33
Field_null(unsigned char *ptr_arg, uint32_t len_arg,
34
enum utype unireg_check_arg, const char *field_name_arg,
35
const CHARSET_INFO * const cs)
36
:Field_str(ptr_arg, len_arg, null, 1,
37
unireg_check_arg, field_name_arg, cs)
39
enum_field_types type() const { return DRIZZLE_TYPE_NULL;}
58
40
int store(const char *, uint32_t, const CHARSET_INFO * const)
41
{ null[0]=1; return 0; }
43
{ null[0]=1; return 0; }
68
44
int store(int64_t, bool)
73
int store_decimal(const type::Decimal *)
45
{ null[0]=1; return 0; }
46
int store_decimal(const my_decimal *)
47
{ null[0]=1; return 0; }
82
50
double val_real(void)
86
52
int64_t val_int(void)
90
type::Decimal *val_decimal(type::Decimal *)
54
my_decimal *val_decimal(my_decimal *) { return 0; }
94
55
String *val_str(String *, String *value2)
99
int cmp(const unsigned char *, const unsigned char *)
103
void sort_string(unsigned char *, uint32_t)
105
uint32_t pack_length() const
56
{ value2->length(0); return value2;}
57
int cmp(const unsigned char *, const unsigned char *) { return 0;}
58
void sort_string(unsigned char *, uint32_t) {}
59
uint32_t pack_length() const { return 0; }
109
60
void sql_type(String &str) const;
110
uint32_t size_of() const
112
return sizeof(*this);
114
uint32_t max_display_length()
61
uint32_t size_of() const { return sizeof(*this); }
62
uint32_t max_display_length() { return 4; }
120
} /* namespace drizzled */
122
#endif /* DRIZZLED_FIELD_NULL_H */