~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/field/num.cc

  • Committer: Monty Taylor
  • Date: 2010-12-26 01:32:11 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101226013211-c1tx52h7evovmijg
fixed dict and eval.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
/**
33
33
  Numeric fields base class constructor.
34
34
*/
35
 
Field_num::Field_num(unsigned char *ptr_arg,
36
 
                     uint32_t len_arg,
37
 
                     unsigned char *null_ptr_arg,
38
 
                     unsigned char null_bit_arg,
39
 
                     utype unireg_check_arg,
 
35
Field_num::Field_num(unsigned char *ptr_arg,uint32_t len_arg, unsigned char *null_ptr_arg,
 
36
                     unsigned char null_bit_arg, utype unireg_check_arg,
40
37
                     const char *field_name_arg,
41
 
                     uint8_t dec_arg,
42
 
                     bool zero_arg,
43
 
                     bool unsigned_arg) :
44
 
  Field(ptr_arg,
45
 
        len_arg,
46
 
        null_ptr_arg,
47
 
        null_bit_arg,
48
 
        unireg_check_arg,
49
 
        field_name_arg),
50
 
  dec(dec_arg),
51
 
  decimal_precision(zero_arg),
52
 
  unsigned_flag(unsigned_arg)
53
 
  {
 
38
                     uint8_t dec_arg, bool zero_arg, bool unsigned_arg)
 
39
  :Field(ptr_arg, len_arg, null_ptr_arg, null_bit_arg,
 
40
         unireg_check_arg, field_name_arg),
 
41
  dec(dec_arg),decimal_precision(zero_arg), unsigned_flag(unsigned_arg)
 
42
{
54
43
}
55
44
 
56
45
 
168
157
    !=0  error
169
158
*/
170
159
 
171
 
int Field_num::store_decimal(const type::Decimal *val)
 
160
int Field_num::store_decimal(const my_decimal *val)
172
161
{
173
162
  int err= 0;
174
163
  int64_t i= convert_decimal2int64_t(val, false, &err);
189
178
    pointer to decimal buffer with value of field
190
179
*/
191
180
 
192
 
type::Decimal* Field_num::val_decimal(type::Decimal *decimal_value)
 
181
my_decimal* Field_num::val_decimal(my_decimal *decimal_value)
193
182
{
194
183
  assert(result_type() == INT_RESULT);
195
184
 
196
185
  int64_t nr= val_int();
197
 
  int2_class_decimal(E_DEC_FATAL_ERROR, nr, false, decimal_value);
 
186
  int2my_decimal(E_DEC_FATAL_ERROR, nr, false, decimal_value);
198
187
  return decimal_value;
199
188
}
200
189