157
157
void set_key_image(const unsigned char *buff,uint32_t length);
158
158
inline void copy()
160
value.copy((char*)get_ptr(), get_length(), charset());
161
char* tmp= value.ptr();
162
memcpy(ptr + sizeof(uint32_t), &tmp, sizeof(char*));
160
unsigned char* tmp= get_ptr();
161
value.copy((char*) tmp, get_length(), charset());
162
tmp=(unsigned char*) value.ptr();
163
memcpy(ptr+sizeof(uint32_t),&tmp,sizeof(char*));
164
virtual unsigned char *pack(unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first);
165
unsigned char *pack_key(unsigned char *to, const unsigned char *from, uint32_t max_length, bool low_byte_first);
166
virtual const unsigned char *unpack(unsigned char *to, const unsigned char *from, uint32_t , bool low_byte_first);
165
virtual unsigned char *pack(unsigned char *to, const unsigned char *from,
166
uint32_t max_length, bool low_byte_first);
167
unsigned char *pack_key(unsigned char *to, const unsigned char *from,
168
uint32_t max_length, bool low_byte_first);
169
virtual const unsigned char *unpack(unsigned char *to, const unsigned char *from,
170
uint32_t , bool low_byte_first);
167
171
void free() { value.free(); }
172
inline void clear_temporary() { memset(&value, 0, sizeof(value)); }
168
173
friend int field_conv(Field *to,Field *from);
169
174
uint32_t size_of() const { return sizeof(*this); }
170
175
bool has_charset(void) const
171
{ return charset() != &my_charset_bin; }
176
{ return charset() == &my_charset_bin ? false : true; }
172
177
uint32_t max_display_length();