~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.cc

Merge Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
** packlength slot and may be from 1-4.
43
43
****************************************************************************/
44
44
 
45
 
Field_blob::Field_blob(unsigned char *ptr_arg, unsigned char *null_ptr_arg, unsigned char null_bit_arg,
46
 
                       enum utype unireg_check_arg, const char *field_name_arg,
47
 
                       TableShare *share, uint32_t blob_pack_length,
48
 
                       const CHARSET_INFO * const cs)
49
 
  :Field_str(ptr_arg, blob_pack_length_to_max_length(blob_pack_length),
50
 
                 null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
51
 
                 cs),
 
45
Field_blob::Field_blob(unsigned char *ptr_arg,
 
46
                       unsigned char *null_ptr_arg,
 
47
                       unsigned char null_bit_arg,
 
48
                                   const char *field_name_arg,
 
49
                       TableShare *share,
 
50
                       uint32_t blob_pack_length,
 
51
                       const CHARSET_INFO * const cs)
 
52
  :Field_str(ptr_arg,
 
53
             blob_pack_length_to_max_length(blob_pack_length),
 
54
             null_ptr_arg,
 
55
             null_bit_arg,
 
56
             field_name_arg,
 
57
             cs),
52
58
   packlength(blob_pack_length)
53
59
{
54
60
  flags|= BLOB_FLAG;
56
62
  /* TODO: why do not fill table->s->blob_field array here? */
57
63
}
58
64
 
59
 
 
60
65
void Field_blob::store_length(unsigned char *i_ptr,
61
66
                              uint32_t i_packlength,
62
67
                              uint32_t i_number,
226
231
  if (value.alloc(new_length))
227
232
    goto oom_error;
228
233
 
229
 
 
230
 
  if (f_is_hex_escape(flags))
231
 
  {
232
 
    copy_length= my_copy_with_hex_escaping(field_charset,
233
 
                                           (char*) value.ptr(), new_length,
234
 
                                            from, length);
235
 
    Field_blob::store_length(copy_length);
236
 
    tmp= value.ptr();
237
 
    memmove(ptr + packlength, &tmp, sizeof(char*));
238
 
    return 0;
239
 
  }
240
234
  /*
241
235
    "length" is OK as "nchars" argument to well_formed_copy_nchars as this
242
236
    is never used to limit the length of the data. The cut of long data