~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.cc

  • Committer: Brian Aker
  • Date: 2010-11-19 19:42:44 UTC
  • mto: (1945.2.1 quick)
  • mto: This revision was merged to the branch mainline in revision 1944.
  • Revision ID: brian@tangent.org-20101119194244-7vx6u5vwzvu9uvex
Remove dead getShare() call which should have been a call on the cache
directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
                                 unsigned char *null_ptr_arg,
57
57
                                 unsigned char null_bit_arg,
58
58
                                 const char *field_name_arg,
59
 
                                 TableShare *share,
60
 
                                 const CHARSET_INFO * const cs)
61
 
  :Field_str(ptr_arg,
62
 
             len_arg,
63
 
             null_ptr_arg,
64
 
             null_bit_arg,
65
 
             field_name_arg, cs),
66
 
   length_bytes(length_bytes_arg)
 
59
                                 const CHARSET_INFO * const cs) :
 
60
  Field_str(ptr_arg,
 
61
            len_arg,
 
62
            null_ptr_arg,
 
63
            null_bit_arg,
 
64
            field_name_arg, cs),
 
65
length_bytes(length_bytes_arg)
67
66
{
68
 
  share->varchar_fields++;
69
67
}
70
68
 
71
69
Field_varstring::Field_varstring(uint32_t len_arg,
72
70
                                 bool maybe_null_arg,
73
71
                                 const char *field_name_arg,
74
 
                                 TableShare *share,
75
 
                                 const CHARSET_INFO * const cs)
76
 
  :Field_str((unsigned char*) 0,
77
 
             len_arg,
78
 
             maybe_null_arg ? (unsigned char*) "": 0,
79
 
             0,
80
 
             field_name_arg,
81
 
             cs),
82
 
   length_bytes(len_arg < 256 ? 1 :2)
 
72
                                 const CHARSET_INFO * const cs) :
 
73
  Field_str((unsigned char*) 0,
 
74
            len_arg,
 
75
            maybe_null_arg ? (unsigned char*) "": 0,
 
76
            0,
 
77
            field_name_arg,
 
78
            cs),
 
79
  length_bytes(len_arg < 256 ? 1 :2)
83
80
{
84
 
  share->varchar_fields++;
85
81
}
86
82
 
87
83
int Field_varstring::store(const char *from,uint32_t length, const CHARSET_INFO * const cs)
120
116
  char buff[64];
121
117
  uint32_t  length;
122
118
  length= (uint32_t) (field_charset->cset->int64_t10_to_str)(field_charset,
123
 
                                                          buff,
124
 
                                                          sizeof(buff),
125
 
                                                          (unsigned_val ? 10:
126
 
                                                           -10),
127
 
                                                           nr);
 
119
                                                             buff,
 
120
                                                             sizeof(buff),
 
121
                                                             (unsigned_val ? 10: -10),
 
122
                                                             nr);
128
123
  return Field_varstring::store(buff, length, field_charset);
129
124
}
130
125
 
224
219
  uint32_t local_char_length= max_key_length / field_charset->mbmaxlen;
225
220
 
226
221
  local_char_length= my_charpos(field_charset, ptr + length_bytes,
227
 
                          ptr + length_bytes + length, local_char_length);
 
222
                                ptr + length_bytes + length, local_char_length);
228
223
  set_if_smaller(length, local_char_length);
229
224
  return field_charset->coll->strnncollsp(field_charset,
230
225
                                          ptr + length_bytes,
269
264
  }
270
265
 
271
266
  tot_length= my_strnxfrm(field_charset,
272
 
                          to, length, ptr + length_bytes,
273
 
                          tot_length);
 
267
                          to, length, ptr + length_bytes,
 
268
                          tot_length);
274
269
  assert(tot_length == length);
275
270
}
276
271