~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Brian Aker
  • Date: 2010-12-27 23:56:33 UTC
  • mfrom: (2034.2.5 clean)
  • Revision ID: brian@tangent.org-20101227235633-9wwf7j35lkf0g262
Merge in additional encapsulation of Decimal

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
      type::Decimal decimal_value;
102
102
      type::Decimal *val= val_decimal(&decimal_value);
103
103
      if (val)
104
 
        return !class_decimal_is_zero(val);
 
104
        return not val->is_zero();
105
105
      return false;
106
106
    }
107
107
 
177
177
    return NULL;
178
178
 
179
179
  end_ptr= (char*) res->ptr()+ res->length();
180
 
  if (str2_class_decimal(E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
 
180
  if (decimal_value->store(E_DEC_FATAL_ERROR & ~E_DEC_BAD_NUM,
181
181
                     res->ptr(), 
182
182
                     res->length(), 
183
 
                     res->charset(),
184
 
                     decimal_value) & E_DEC_BAD_NUM)
 
183
                     res->charset()) & E_DEC_BAD_NUM)
185
184
  {
186
185
    push_warning_printf(current_session, 
187
186
                        DRIZZLE_ERROR::WARN_LEVEL_WARN,
198
197
  type::Time ltime;
199
198
  if (get_date(&ltime, TIME_FUZZY_DATE))
200
199
  {
201
 
    class_decimal_set_zero(decimal_value);
 
200
    decimal_value->set_zero();
202
201
    null_value= 1;                               // set NULL, stop processing
203
202
    return NULL;
204
203
  }
211
210
  type::Time ltime;
212
211
  if (get_time(&ltime))
213
212
  {
214
 
    class_decimal_set_zero(decimal_value);
 
213
    decimal_value->set_zero();
215
214
    return NULL;
216
215
  }
217
216
  return date2_class_decimal(&ltime, decimal_value);
235
234
  type::Decimal value, *dec_val= val_decimal(&value);
236
235
  if (null_value)
237
236
    return 0;
238
 
  class_decimal2int(E_DEC_FATAL_ERROR, dec_val, unsigned_flag, &result);
 
237
  dec_val->val_int32(E_DEC_FATAL_ERROR, unsigned_flag, &result);
239
238
  return result;
240
239
}
241
240