~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cmpfunc.cc

  • Committer: Monty Taylor
  • Date: 2009-05-22 17:09:57 UTC
  • mfrom: (1008.5.3 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 1036.
  • Revision ID: mordred@inaugust.com-20090522170957-qmwlv36rbrraxaxw
Merged Lee from lp:~kalebral/drizzle/drizzle-clean-code

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "drizzled/cached_item.h"
30
30
#include "drizzled/item/cache_int.h"
31
31
#include "drizzled/item/int_with_ref.h"
32
 
#include "drizzled/function/bit.h"
33
32
#include "drizzled/check_stack_overrun.h"
34
33
 
35
34
 
3866
3865
}
3867
3866
 
3868
3867
 
3869
 
int64_t Item_func_bit_or::val_int()
3870
 
{
3871
 
  assert(fixed == 1);
3872
 
  uint64_t arg1= (uint64_t) args[0]->val_int();
3873
 
  if (args[0]->null_value)
3874
 
  {
3875
 
    null_value=1; /* purecov: inspected */
3876
 
    return 0; /* purecov: inspected */
3877
 
  }
3878
 
  uint64_t arg2= (uint64_t) args[1]->val_int();
3879
 
  if (args[1]->null_value)
3880
 
  {
3881
 
    null_value=1;
3882
 
    return 0;
3883
 
  }
3884
 
  null_value=0;
3885
 
  return (int64_t) (arg1 | arg2);
3886
 
}
3887
 
 
3888
 
 
3889
 
int64_t Item_func_bit_and::val_int()
3890
 
{
3891
 
  assert(fixed == 1);
3892
 
  uint64_t arg1= (uint64_t) args[0]->val_int();
3893
 
  if (args[0]->null_value)
3894
 
  {
3895
 
    null_value=1; /* purecov: inspected */
3896
 
    return 0; /* purecov: inspected */
3897
 
  }
3898
 
  uint64_t arg2= (uint64_t) args[1]->val_int();
3899
 
  if (args[1]->null_value)
3900
 
  {
3901
 
    null_value=1; /* purecov: inspected */
3902
 
    return 0; /* purecov: inspected */
3903
 
  }
3904
 
  null_value=0;
3905
 
  return (int64_t) (arg1 & arg2);
3906
 
}
3907
 
 
3908
3868
Item_cond::Item_cond(Session *session, Item_cond *item)
3909
3869
  :Item_bool_func(session, item),
3910
3870
   abort_on_null(item->abort_on_null),