~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/function/math/minus.cc

  • Committer: Lee Bieber
  • Date: 2010-11-14 23:15:42 UTC
  • mfrom: (1929.1.42 warning-stack-frame)
  • Revision ID: kalebral@gmail.com-20101114231542-fnnu6ydd2p17n582
Merge Monty - fix bug 672372: some functions use > 32k stack

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
20
20
#include "config.h"
21
21
 
22
22
#include <drizzled/function/math/minus.h>
23
 
#include <drizzled/type/decimal.h>
24
23
 
25
24
namespace drizzled
26
25
{
59
58
  See Item_func_plus::decimal_op for comments.
60
59
*/
61
60
 
62
 
type::Decimal *Item_func_minus::decimal_op(type::Decimal *decimal_value)
 
61
my_decimal *Item_func_minus::decimal_op(my_decimal *decimal_value)
63
62
{
64
 
  type::Decimal value1, *val1;
65
 
  type::Decimal value2, *val2=
 
63
  my_decimal value1, *val1;
 
64
  my_decimal value2, *val2=
66
65
 
67
66
  val1= args[0]->val_decimal(&value1);
68
67
  if ((null_value= args[0]->null_value))
69
68
    return 0;
70
69
  val2= args[1]->val_decimal(&value2);
71
70
  if (!(null_value= (args[1]->null_value ||
72
 
                     (class_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1,
 
71
                     (my_decimal_sub(E_DEC_FATAL_ERROR, decimal_value, val1,
73
72
                                     val2) > 3))))
74
73
    return decimal_value;
75
74
  return 0;