~drizzle-pbxt/drizzle/drizzle-pbxt-2

« back to all changes in this revision

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

  • Committer: Paul McCullagh
  • Date: 2009-11-10 14:18:39 UTC
  • mfrom: (1038.1.7 drizzle-pbxt-pre-merge)
  • Revision ID: paul.mccullagh@primebase.org-20091110141839-2j3k43b17ag6f605
Merged Drizzle trunk and PBXT 1.0.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <drizzled/server_includes.h>
21
21
#include <drizzled/function/math/mod.h>
22
22
 
 
23
#include <algorithm>
 
24
 
 
25
using namespace std;
 
26
 
23
27
int64_t Item_func_mod::int_op()
24
28
{
25
29
  assert(fixed == 1);
28
32
  int64_t result;
29
33
 
30
34
  if ((null_value= args[0]->null_value || args[1]->null_value))
31
 
    return 0; /* purecov: inspected */
 
35
    return 0;
32
36
  if (val2 == 0)
33
37
  {
34
38
    signal_divide_by_null();
51
55
  double value= args[0]->val_real();
52
56
  double val2=  args[1]->val_real();
53
57
  if ((null_value= args[0]->null_value || args[1]->null_value))
54
 
    return 0.0; /* purecov: inspected */
 
58
    return 0.0;
55
59
  if (val2 == 0.0)
56
60
  {
57
61
    signal_divide_by_null();
88
92
 
89
93
void Item_func_mod::result_precision()
90
94
{
91
 
  decimals= cmax(args[0]->decimals, args[1]->decimals);
92
 
  max_length= cmax(args[0]->max_length, args[1]->max_length);
 
95
  decimals= max(args[0]->decimals, args[1]->decimals);
 
96
  max_length= max(args[0]->max_length, args[1]->max_length);
93
97
}
94
98
 
95
99