~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/functions/neg.cc

  • Committer: Monty Taylor
  • Date: 2008-11-16 23:47:43 UTC
  • mto: (584.1.10 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116234743-c38gmv0pa2kdefaj
BrokeĀ outĀ cached_item.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
21
 
 
22
 
#include <drizzled/function/math/neg.h>
23
 
 
24
 
namespace drizzled
25
 
{
 
20
#include <drizzled/server_includes.h>
 
21
#include CSTDINT_H
 
22
#include <drizzled/functions/neg.h>
26
23
 
27
24
double Item_func_neg::real_op()
28
25
{
76
73
    int64_t val= args[0]->val_int();
77
74
    if ((uint64_t) val >= (uint64_t) INT64_MIN &&
78
75
        ((uint64_t) val != (uint64_t) INT64_MIN ||
79
 
          args[0]->type() != INT_ITEM))
 
76
          args[0]->type() != INT_ITEM))        
80
77
    {
81
78
      /*
82
79
        Ensure that result is converted to DECIMAL, as int64_t can't hold
88
85
  unsigned_flag= 0;
89
86
  return;
90
87
}
91
 
 
92
 
} /* namespace drizzled */