~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/varstring.cc

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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
59
                                 const CHARSET_INFO * const cs) :
61
60
  Field_str(ptr_arg,
62
61
            len_arg,
65
64
            field_name_arg, cs),
66
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
72
                                 const CHARSET_INFO * const cs) :
76
73
  Field_str((unsigned char*) 0,
77
74
            len_arg,
81
78
            cs),
82
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)
169
165
}
170
166
 
171
167
 
172
 
my_decimal *Field_varstring::val_decimal(my_decimal *decimal_value)
 
168
type::Decimal *Field_varstring::val_decimal(type::Decimal *decimal_value)
173
169
{
174
170
  uint32_t length;
175
171
 
177
173
 
178
174
  length= length_bytes == 1 ? (uint32_t) *ptr : uint2korr(ptr);
179
175
 
180
 
  str2my_decimal(E_DEC_FATAL_ERROR, (char*) ptr+length_bytes, length,
181
 
                 charset(), decimal_value);
 
176
  decimal_value->store(E_DEC_FATAL_ERROR, (char*) ptr+length_bytes, length, charset());
 
177
 
182
178
  return decimal_value;
183
179
}
184
180