~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.cc

  • Committer: Brian Aker
  • Date: 2008-11-18 23:19:19 UTC
  • mfrom: (584.1.16 devel)
  • Revision ID: brian@tangent.org-20081118231919-w9sr347dtiwhccml
Merge of Monty's work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <drizzled/server_includes.h>
23
23
#include <drizzled/field/blob.h>
 
24
#include <drizzled/table.h>
 
25
#include <drizzled/session.h>
 
26
 
24
27
 
25
28
uint32_t
26
29
blob_pack_length_to_max_length(uint32_t arg)
85
88
}
86
89
 
87
90
 
 
91
void Field_blob::store_length(unsigned char *i_ptr, uint32_t i_packlength,
 
92
                  uint32_t i_number)
 
93
{
 
94
  store_length(i_ptr, i_packlength, i_number, table->s->db_low_byte_first);
 
95
}
 
96
 
 
97
 
88
98
uint32_t Field_blob::get_length(const unsigned char *pos,
89
99
                              uint32_t packlength_arg,
90
100
                              bool low_byte_first __attribute__((unused)))
121
131
}
122
132
 
123
133
 
 
134
uint32_t Field_blob::get_packed_size(const unsigned char *ptr_arg,
 
135
                                bool low_byte_first)
 
136
{
 
137
  return packlength + get_length(ptr_arg, packlength, low_byte_first);
 
138
}
 
139
 
 
140
 
 
141
uint32_t Field_blob::get_length(uint32_t row_offset)
 
142
{
 
143
  return get_length(ptr+row_offset, this->packlength,
 
144
                    table->s->db_low_byte_first);
 
145
}
 
146
 
 
147
 
 
148
uint32_t Field_blob::get_length(const unsigned char *ptr_arg)
 
149
{
 
150
  return get_length(ptr_arg, this->packlength, table->s->db_low_byte_first);
 
151
}
 
152
 
 
153
 
124
154
/**
125
155
  Put a blob length field into a record buffer.
126
156
 
420
450
 
421
451
uint32_t Field_blob::sort_length() const
422
452
{
423
 
  return (uint32_t) (current_session->variables.max_sort_length + 
 
453
  return (uint32_t) (current_session->variables.max_sort_length +
424
454
                   (field_charset == &my_charset_bin ? 0 : packlength));
425
455
}
426
456
 
460
490
      }
461
491
    }
462
492
    memcpy(&blob,ptr+packlength,sizeof(char*));
463
 
    
 
493
 
464
494
    blob_length=my_strnxfrm(field_charset,
465
495
                            to, length, blob, blob_length);
466
496
    assert(blob_length == length);
468
498
}
469
499
 
470
500
 
 
501
uint32_t Field_blob::pack_length() const
 
502
{
 
503
  return (uint32_t) (packlength+table->s->blob_ptr_size);
 
504
}
 
505
 
 
506
 
471
507
void Field_blob::sql_type(String &res) const
472
508
{
473
509
  if (charset() == &my_charset_bin)
718
754
  }
719
755
}
720
756
 
 
757
bool Field_blob::in_read_set()
 
758
{
 
759
  return bitmap_is_set(table->read_set, field_index);
 
760
}
 
761
 
 
762
 
 
763
bool Field_blob::in_write_set()
 
764
{
 
765
  return bitmap_is_set(table->write_set, field_index);
 
766
}