~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/blob.cc

  • Committer: Olaf van der Spek
  • Date: 2011-04-05 12:26:58 UTC
  • mto: (2278.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 2272.
  • Revision ID: olafvdspek@gmail.com-20110405122658-xxrvmobwwwwf3oct
Refactor Open_tables_state

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/table.h>
25
25
#include <drizzled/session.h>
26
26
#include <plugin/myisam/myisam.h>
 
27
#include <drizzled/system_variables.h>
27
28
 
28
29
#include <string>
29
30
#include <algorithm>
51
52
                       unsigned char null_bit_arg,
52
53
                                   const char *field_name_arg,
53
54
                       TableShare *share,
54
 
                       const CHARSET_INFO * const cs)
 
55
                       const charset_info_st * const cs)
55
56
  :Field_str(ptr_arg,
56
57
             blob_pack_length_to_max_length(sizeof(uint32_t)),
57
58
             null_ptr_arg,
141
142
}
142
143
 
143
144
 
144
 
int Field_blob::store(const char *from,uint32_t length, const CHARSET_INFO * const cs)
 
145
int Field_blob::store(const char *from,uint32_t length, const charset_info_st * const cs)
145
146
{
146
147
  uint32_t copy_length, new_length;
147
148
  const char *well_formed_error_pos;
208
209
 
209
210
int Field_blob::store(double nr)
210
211
{
211
 
  const CHARSET_INFO * const cs=charset();
 
212
  const charset_info_st * const cs=charset();
212
213
  ASSERT_COLUMN_MARKED_FOR_WRITE;
213
214
  value.set_real(nr, NOT_FIXED_DEC, cs);
214
215
  return Field_blob::store(value.ptr(),(uint32_t) value.length(), cs);
217
218
 
218
219
int Field_blob::store(int64_t nr, bool unsigned_val)
219
220
{
220
 
  const CHARSET_INFO * const cs=charset();
 
221
  const charset_info_st * const cs=charset();
221
222
  ASSERT_COLUMN_MARKED_FOR_WRITE;
222
223
  value.set_int(nr, unsigned_val, cs);
223
224
  return Field_blob::store(value.ptr(), (uint32_t) value.length(), cs);
229
230
  int not_used;
230
231
  char *end_not_used, *blob;
231
232
  uint32_t length;
232
 
  const CHARSET_INFO *cs;
 
233
  const charset_info_st *cs;
233
234
 
234
235
  ASSERT_COLUMN_MARKED_FOR_READ;
235
236
 
407
408
  unsigned char *blob1;
408
409
  uint32_t blob_length=get_length(ptr);
409
410
  memcpy(&blob1,ptr+sizeof(uint32_t),sizeof(char*));
410
 
  const CHARSET_INFO * const cs= charset();
 
411
  const charset_info_st * const cs= charset();
411
412
  uint32_t local_char_length= max_key_length / cs->mbmaxlen;
412
413
  local_char_length= my_charpos(cs, blob1, blob1+blob_length,
413
414
                                local_char_length);