~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.cc

  • Committer: Brian Aker
  • Date: 2010-12-25 00:28:49 UTC
  • mto: This revision was merged to the branch mainline in revision 2031.
  • Revision ID: brian@tangent.org-20101225002849-g73mg6ihulajis0o
First pass in refactoring of the name of my_decimal.

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
      my_decimal decimal_value;
102
102
      my_decimal *val= val_decimal(&decimal_value);
103
103
      if (val)
104
 
        return !my_decimal_is_zero(val);
 
104
        return !class_decimal_is_zero(val);
105
105
      return false;
106
106
    }
107
107
 
144
144
  if (null_value)
145
145
    return NULL;
146
146
 
147
 
  my_decimal_round(E_DEC_FATAL_ERROR, dec, decimals, false, &dec_buf);
 
147
  class_decimal_round(E_DEC_FATAL_ERROR, dec, decimals, false, &dec_buf);
148
148
  my_decimal2string(E_DEC_FATAL_ERROR, &dec_buf, 0, 0, 0, str);
149
149
  return str;
150
150
}
198
198
  DRIZZLE_TIME ltime;
199
199
  if (get_date(&ltime, TIME_FUZZY_DATE))
200
200
  {
201
 
    my_decimal_set_zero(decimal_value);
 
201
    class_decimal_set_zero(decimal_value);
202
202
    null_value= 1;                               // set NULL, stop processing
203
203
    return NULL;
204
204
  }
211
211
  DRIZZLE_TIME ltime;
212
212
  if (get_time(&ltime))
213
213
  {
214
 
    my_decimal_set_zero(decimal_value);
 
214
    class_decimal_set_zero(decimal_value);
215
215
    return NULL;
216
216
  }
217
217
  return date2my_decimal(&ltime, decimal_value);
340
340
  Item_result restype= result_type();
341
341
 
342
342
  if ((restype == DECIMAL_RESULT) || (restype == INT_RESULT))
343
 
    return min(my_decimal_length_to_precision(max_length, decimals, unsigned_flag),
 
343
    return min(class_decimal_length_to_precision(max_length, decimals, unsigned_flag),
344
344
               (uint32_t) DECIMAL_MAX_PRECISION);
345
345
  return min(max_length, (uint32_t) DECIMAL_MAX_PRECISION);
346
346
}
347
347
 
348
348
int Item::decimal_int_part() const
349
349
{
350
 
  return my_decimal_int_part(decimal_precision(), decimals);
 
350
  return class_decimal_int_part(decimal_precision(), decimals);
351
351
}
352
352
 
353
353
void Item::print(String *str, enum_query_type)
1553
1553
    if (item->null_value)
1554
1554
      return 1;                                 // This must be true
1555
1555
    field_val= field->val_decimal(&field_buf);
1556
 
    return !my_decimal_cmp(item_val, field_val);
 
1556
    return !class_decimal_cmp(item_val, field_val);
1557
1557
  }
1558
1558
 
1559
1559
  double result= item->val_real();
1687
1687
          +1: for decimal point
1688
1688
        */
1689
1689
 
1690
 
        overflow= my_decimal_precision_to_length(intg + dec, dec,
 
1690
        overflow= class_decimal_precision_to_length(intg + dec, dec,
1691
1691
                                                 item->unsigned_flag) - len;
1692
1692
 
1693
1693
        if (overflow > 0)