43
40
static const uint32_t MAX_SIZE;
45
41
/* Store number of bytes used to store length (1 or 2) */
46
42
uint32_t length_bytes;
48
43
Field_varstring(unsigned char *ptr_arg,
50
45
uint32_t length_bytes_arg,
51
46
unsigned char *null_ptr_arg,
52
47
unsigned char null_bit_arg,
53
48
const char *field_name_arg,
54
50
const CHARSET_INFO * const cs);
55
51
Field_varstring(uint32_t len_arg,
56
52
bool maybe_null_arg,
57
53
const char *field_name_arg,
58
55
const CHARSET_INFO * const cs);
60
57
enum_field_types type() const { return DRIZZLE_TYPE_VARCHAR; }
61
58
enum ha_base_keytype key_type() const;
59
uint32_t row_pack_length() { return field_length; }
62
60
bool zero_pack() const { return 0; }
63
61
int reset(void) { memset(ptr, 0, field_length+length_bytes); return 0; }
64
62
uint32_t pack_length() const { return (uint32_t) field_length+length_bytes; }
65
uint32_t pack_length_no_ptr() const { return length_bytes; }
66
63
uint32_t key_length() const { return (uint32_t) field_length; }
67
64
uint32_t sort_length() const
69
66
return (uint32_t) field_length + (field_charset == &my_charset_bin ?
72
69
int store(const char *to,uint32_t length, const CHARSET_INFO * const charset);
78
75
int64_t val_int(void);
79
76
String *val_str(String*,String *);
80
77
inline String *val_str(String *str) { return val_str(str, str); }
81
type::Decimal *val_decimal(type::Decimal *);
78
my_decimal *val_decimal(my_decimal *);
82
79
int cmp_max(const unsigned char *, const unsigned char *, uint32_t max_length);
83
80
inline int cmp(const unsigned char *str) { return cmp(ptr,str); }
84
81
int cmp(const unsigned char *a,const unsigned char *b)
109
106
enum_field_types real_type() const { return DRIZZLE_TYPE_VARCHAR; }
110
107
bool has_charset(void) const
111
108
{ return charset() == &my_charset_bin ? false : true; }
112
Field *new_field(memory::Root *root, Table *new_table, bool keep_type);
113
Field *new_key_field(memory::Root *root, Table *new_table,
109
Field *new_field(MEM_ROOT *root, Table *new_table, bool keep_type);
110
Field *new_key_field(MEM_ROOT *root, Table *new_table,
114
111
unsigned char *new_ptr, unsigned char *new_null_ptr,
115
112
uint32_t new_null_bit);
118
} /* namespace drizzled */
120
115
#endif /* DRIZZLED_FIELD_VARSTRING_H */