~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/user_var_entry.cc

  • Committer: Brian Aker
  • Date: 2010-12-27 19:18:58 UTC
  • mfrom: (2035 staging)
  • mto: (2035.1.1 clean)
  • mto: This revision was merged to the branch mainline in revision 2037.
  • Revision ID: brian@tangent.org-20101227191858-h11rg8ncrkiklg3f
Manage merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
  case DECIMAL_RESULT:
42
42
    {
43
43
      double result;
44
 
      my_decimal2double(E_DEC_FATAL_ERROR, (my_decimal *)value, &result);
 
44
      class_decimal2double(E_DEC_FATAL_ERROR, (type::Decimal *)value, &result);
45
45
      return result;
46
46
    }
47
47
 
73
73
  case DECIMAL_RESULT:
74
74
    {
75
75
      int64_t result;
76
 
      my_decimal2int(E_DEC_FATAL_ERROR, (my_decimal *)value, 0, &result);
 
76
      class_decimal2int(E_DEC_FATAL_ERROR, (type::Decimal *)value, 0, &result);
77
77
      return result;
78
78
    }
79
79
 
113
113
    break;
114
114
 
115
115
  case DECIMAL_RESULT:
116
 
    my_decimal2string(E_DEC_FATAL_ERROR, (my_decimal *)value, 0, 0, 0, str);
 
116
    class_decimal2string(E_DEC_FATAL_ERROR, (type::Decimal *)value, 0, 0, 0, str);
117
117
    break;
118
118
 
119
119
  case STRING_RESULT:
130
130
 
131
131
/** Get the value of a variable as a decimal. */
132
132
 
133
 
my_decimal *user_var_entry::val_decimal(bool *null_value, my_decimal *val)
 
133
type::Decimal *user_var_entry::val_decimal(bool *null_value, type::Decimal *val)
134
134
{
135
135
  if ((*null_value= (value == 0)))
136
136
    return 0;
137
137
 
138
138
  switch (type) {
139
139
  case REAL_RESULT:
140
 
    double2my_decimal(E_DEC_FATAL_ERROR, *(double*) value, val);
 
140
    double2_class_decimal(E_DEC_FATAL_ERROR, *(double*) value, val);
141
141
    break;
142
142
 
143
143
  case INT_RESULT:
144
 
    int2my_decimal(E_DEC_FATAL_ERROR, *(int64_t*) value, 0, val);
 
144
    int2_class_decimal(E_DEC_FATAL_ERROR, *(int64_t*) value, 0, val);
145
145
    break;
146
146
 
147
147
  case DECIMAL_RESULT:
148
 
    val= (my_decimal *)value;
 
148
    val= (type::Decimal *)value;
149
149
    break;
150
150
 
151
151
  case STRING_RESULT:
152
 
    str2my_decimal(E_DEC_FATAL_ERROR, value, length, collation.collation, val);
 
152
    str2_class_decimal(E_DEC_FATAL_ERROR, value, length, collation.collation, val);
153
153
    break;
154
154
 
155
155
  case ROW_RESULT:
217
217
 
218
218
    memcpy(value, ptr, arg_length);
219
219
    if (arg_type == DECIMAL_RESULT)
220
 
      ((my_decimal*)value)->fix_buffer_pointer();
 
220
      ((type::Decimal*)value)->fix_buffer_pointer();
221
221
    length= arg_length;
222
222
    collation.set(cs, dv);
223
223
    unsigned_flag= unsigned_arg;