~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/sum.cc

  • Committer: Monty Taylor
  • Date: 2010-02-05 08:11:15 UTC
  • mfrom: (1283 build)
  • mto: (1273.13.43 fix_is)
  • mto: This revision was merged to the branch mainline in revision 1300.
  • Revision ID: mordred@inaugust.com-20100205081115-dr82nvrwv4lvw7sd
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
#include <algorithm>
42
42
 
43
 
using namespace drizzled;
44
43
using namespace std;
45
44
 
 
45
namespace drizzled
 
46
{
 
47
 
46
48
extern my_decimal decimal_zero;
47
49
extern plugin::StorageEngine *heap_engine;
48
50
 
874
876
 
875
877
/***************************************************************************/
876
878
 
877
 
#ifdef __cplusplus
878
 
extern "C" {
879
 
#endif
880
 
 
881
879
/* Declarations for auxilary C-callbacks */
882
880
 
883
881
static int simple_raw_key_cmp(void* arg, const void* key1, const void* key2)
893
891
  return ((Item_sum_distinct*) (item))->unique_walk_function(element);
894
892
}
895
893
 
896
 
#ifdef __cplusplus
897
 
}
898
 
#endif
899
 
 
900
894
/* Item_sum_distinct */
901
895
 
902
896
Item_sum_distinct::Item_sum_distinct(Item *item_arg)
2514
2508
  return 0;
2515
2509
}
2516
2510
 
2517
 
#ifdef __cplusplus
2518
 
extern "C" {
2519
 
#endif
2520
 
 
2521
2511
static int count_distinct_walk(void *,
2522
2512
                               uint32_t ,
2523
2513
                               void *arg)
2526
2516
  return 0;
2527
2517
}
2528
2518
 
2529
 
#ifdef __cplusplus
2530
 
}
2531
 
#endif
2532
 
 
2533
 
 
2534
 
 
2535
2519
void Item_sum_count_distinct::cleanup()
2536
2520
{
2537
2521
  Item_sum_int::cleanup();
3322
3306
double Item_func_group_concat::val_real()
3323
3307
{
3324
3308
  String *res;  res=val_str(&str_value);
3325
 
  return res ? my_atof(res->c_ptr()) : 0.0;
 
3309
  return res ? internal::my_atof(res->c_ptr()) : 0.0;
3326
3310
}
3327
3311
 
3328
3312
int64_t Item_func_group_concat::val_int()
3333
3317
  if (!(res= val_str(&str_value)))
3334
3318
    return (int64_t) 0;
3335
3319
  end_ptr= (char*) res->ptr()+ res->length();
3336
 
  return my_strtoll10(res->ptr(), &end_ptr, &error);
 
3320
  return internal::my_strtoll10(res->ptr(), &end_ptr, &error);
3337
3321
}
3338
3322
 
3339
3323
String* Item_func_group_concat::val_str(String* )
3396
3380
  if (!original && unique_filter)
3397
3381
    delete unique_filter;
3398
3382
}
 
3383
 
 
3384
} /* namespace drizzled */