~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/math_functions/ceiling.cc

  • Committer: Lee Bieber
  • Date: 2010-12-23 23:11:00 UTC
  • mfrom: (2024.1.1 clean)
  • Revision ID: kalebral@gmail.com-20101223231100-0rqirgz7ugkl10yp
Merge Brian - session list cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include "config.h"
21
21
#include <math.h>
22
22
#include "ceiling.h"
23
 
#include <drizzled/type/decimal.h>
24
23
 
25
24
namespace drizzled
26
25
{
35
34
    break;
36
35
  case DECIMAL_RESULT:
37
36
  {
38
 
    type::Decimal dec_buf, *dec;
 
37
    my_decimal dec_buf, *dec;
39
38
    if ((dec= Item_func_ceiling::decimal_op(&dec_buf)))
40
 
      dec->val_int32(E_DEC_FATAL_ERROR, unsigned_flag, &result);
 
39
      my_decimal2int(E_DEC_FATAL_ERROR, dec, unsigned_flag, &result);
41
40
    else
42
41
      result= 0;
43
42
    break;
59
58
  return ceil(value);
60
59
}
61
60
 
62
 
type::Decimal *Item_func_ceiling::decimal_op(type::Decimal *decimal_value)
 
61
my_decimal *Item_func_ceiling::decimal_op(my_decimal *decimal_value)
63
62
{
64
 
  type::Decimal val, *value= args[0]->val_decimal(&val);
 
63
  my_decimal val, *value= args[0]->val_decimal(&val);
65
64
  if (!(null_value= (args[0]->null_value ||
66
 
                     class_decimal_ceiling(E_DEC_FATAL_ERROR, value,
 
65
                     my_decimal_ceiling(E_DEC_FATAL_ERROR, value,
67
66
                                        decimal_value) > 1)))
68
67
    return decimal_value;
69
68
  return 0;