~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Patrick Crews
  • Date: 2010-12-07 20:02:50 UTC
  • Revision ID: gleebix@gmail.com-20101207200250-6a27jgqalgw5bsb5
Added disabled.def file to disable drizzleslap due to Bug#684269.  Need to skip for tarball release this round

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
36
36
{
37
37
  int64_t value= args[0]->val_int();
38
38
  null_value= args[0]->null_value;
39
 
 
40
39
  return -value;
41
40
}
42
41
 
43
42
 
44
 
type::Decimal *Item_func_neg::decimal_op(type::Decimal *decimal_value)
 
43
my_decimal *Item_func_neg::decimal_op(my_decimal *decimal_value)
45
44
{
46
 
  type::Decimal val, *value= args[0]->val_decimal(&val);
 
45
  my_decimal val, *value= args[0]->val_decimal(&val);
47
46
  if (!(null_value= args[0]->null_value))
48
47
  {
49
 
    class_decimal2decimal(value, decimal_value);
50
 
    class_decimal_neg(decimal_value);
 
48
    my_decimal2decimal(value, decimal_value);
 
49
    my_decimal_neg(decimal_value);
51
50
    return decimal_value;
52
51
  }
53
52
  return 0;
86
85
      hybrid_type= DECIMAL_RESULT;
87
86
    }
88
87
  }
89
 
  unsigned_flag= false;
 
88
  unsigned_flag= 0;
 
89
  return;
90
90
}
91
91
 
92
92
} /* namespace drizzled */