18
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
#ifndef DRIZZLE_SERVER_FIELD_NULL
22
#define DRIZZLE_SERVER_FIELD_NULL
25
Everything saved in this will disappear. It will always return NULL
21
#ifndef DRIZZLED_FIELD_NULL_H
22
#define DRIZZLED_FIELD_NULL_H
24
#include <drizzled/field/str.h>
27
* Everything saved in this will disappear. It will always return NULL
28
class Field_null :public Field_str {
30
class Field_null :public Field_str
32
static unsigned char null[1];
31
Field_null(uchar *ptr_arg, uint32_t len_arg,
32
enum utype unireg_check_arg, const char *field_name_arg,
33
const CHARSET_INFO * const cs)
34
:Field_str(ptr_arg, len_arg, null, 1,
35
unireg_check_arg, field_name_arg, cs)
37
enum_field_types type() const { return DRIZZLE_TYPE_NULL;}
38
int store(const char *to __attribute__((unused)),
39
uint length __attribute__((unused)),
40
const CHARSET_INFO * const cs __attribute__((unused)))
41
{ null[0]=1; return 0; }
42
int store(double nr __attribute__((unused)))
43
{ null[0]=1; return 0; }
44
int store(int64_t nr __attribute__((unused)),
45
bool unsigned_val __attribute__((unused)))
46
{ null[0]=1; return 0; }
47
int store_decimal(const my_decimal *d __attribute__((unused)))
48
{ null[0]=1; return 0; }
40
Field_null(unsigned char *ptr_arg,
42
const char *field_name_arg,
43
const CHARSET_INFO * const cs)
51
enum_field_types type() const
53
return DRIZZLE_TYPE_NULL;
55
int store(const char *, uint32_t, const CHARSET_INFO * const)
65
int store(int64_t, bool)
70
int store_decimal(const my_decimal *)
51
79
double val_real(void)
53
83
int64_t val_int(void)
55
my_decimal *val_decimal(my_decimal *) { return 0; }
56
String *val_str(String *value __attribute__((unused)),
58
{ value2->length(0); return value2;}
59
int cmp(const uchar *a __attribute__((unused)),
60
const uchar *b __attribute__((unused))) { return 0;}
61
void sort_string(uchar *buff __attribute__((unused)),
62
uint length __attribute__((unused))) {}
63
uint32_t pack_length() const { return 0; }
87
my_decimal *val_decimal(my_decimal *)
91
String *val_str(String *, String *value2)
96
int cmp(const unsigned char *, const unsigned char *)
100
void sort_string(unsigned char *, uint32_t)
102
uint32_t pack_length() const
64
106
void sql_type(String &str) const;
65
uint size_of() const { return sizeof(*this); }
66
uint32_t max_display_length() { return 4; }
107
uint32_t size_of() const
109
return sizeof(*this);
111
uint32_t max_display_length()
117
#endif /* DRIZZLED_FIELD_NULL_H */