157
157
void set_key_image(const unsigned char *buff,uint32_t length);
158
158
inline void copy()
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*));
160
value.copy((char*)get_ptr(), get_length(), charset());
161
char* tmp= value.ptr();
162
memcpy(ptr + sizeof(uint32_t), &tmp, sizeof(char*));
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);
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);
171
167
void free() { value.free(); }
172
inline void clear_temporary() { memset(&value, 0, sizeof(value)); }
173
168
friend int field_conv(Field *to,Field *from);
174
169
uint32_t size_of() const { return sizeof(*this); }
175
170
bool has_charset(void) const
176
{ return charset() == &my_charset_bin ? false : true; }
171
{ return charset() != &my_charset_bin; }
177
172
uint32_t max_display_length();