~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cmpfunc.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-13 01:03:01 UTC
  • mto: (1126.9.2 captain-20090915-01)
  • mto: This revision was merged to the branch mainline in revision 1133.
  • Revision ID: osullivan.padraig@gmail.com-20090913010301-tcvvezipx1124acy
Added calls to the dtrace delete begin/end probes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include "drizzled/function/math/int.h"
32
32
#include "drizzled/function/numhybrid.h"
33
33
#include "drizzled/session.h"
34
 
#include "drizzled/common.h"
35
 
#include "drizzled/qsort_cmp.h"
36
 
 
37
 
namespace drizzled
38
 
{
39
34
 
40
35
extern Item_result item_cmp_type(Item_result a,Item_result b);
41
36
class Item_bool_func2;
47
42
 
48
43
typedef int (*Item_field_cmpfunc)(Item_field *f1, Item_field *f2, void *arg);
49
44
 
50
 
uint64_t get_datetime_value(Session *session, 
51
 
                            Item ***item_arg, 
52
 
                            Item **cache_arg,
53
 
                            Item *warn_item, 
54
 
                            bool *is_null);
55
 
 
56
 
class Arg_comparator: public memory::SqlAlloc
 
45
class Arg_comparator: public Sql_alloc
57
46
{
58
47
  Item **a, **b;
59
48
  arg_cmp_func func;
765
754
 
766
755
/* A vector of values of some type  */
767
756
 
768
 
class in_vector :public memory::SqlAlloc
 
757
class in_vector :public Sql_alloc
769
758
{
770
759
public:
771
760
  char *base;
777
766
  in_vector() {}
778
767
  in_vector(uint32_t elements,uint32_t element_length,qsort2_cmp cmp_func,
779
768
            const CHARSET_INFO * const cmp_coll)
780
 
    :base((char*) memory::sql_calloc(elements*element_length)),
 
769
    :base((char*) sql_calloc(elements*element_length)),
781
770
     size(element_length), compare(cmp_func), collation(cmp_coll),
782
771
     count(elements), used_count(elements) {}
783
772
  virtual ~in_vector() {}
784
773
  virtual void set(uint32_t pos,Item *item)=0;
785
774
  virtual unsigned char *get_value(Item *item)=0;
786
 
  void sort();
 
775
  void sort()
 
776
  {
 
777
    my_qsort2(base,used_count,size,compare, (void *) collation);
 
778
  }
787
779
  int find(Item *item);
788
780
 
789
781
  /*
943
935
** Classes for easy comparing of non const items
944
936
*/
945
937
 
946
 
class cmp_item :public memory::SqlAlloc
 
938
class cmp_item :public Sql_alloc
947
939
{
948
940
public:
949
941
  const CHARSET_INFO *cmp_charset;
1580
1572
  { return fields.head()->collation.collation; }
1581
1573
};
1582
1574
 
1583
 
class COND_EQUAL: public memory::SqlAlloc
 
1575
class COND_EQUAL: public Sql_alloc
1584
1576
{
1585
1577
public:
1586
1578
  uint32_t max_members;               /* max number of members the current level
1694
1686
  void top_level_item() {}
1695
1687
};
1696
1688
 
1697
 
enum_field_types agg_field_type(Item **items, uint32_t nitems);
1698
 
 
1699
1689
 
1700
1690
/* Some useful inline functions */
1701
1691
 
1708
1698
 
1709
1699
Item *and_expressions(Item *a, Item *b, Item **org_item);
1710
1700
 
1711
 
} /* namespace drizzled */
1712
 
 
1713
1701
#endif /* DRIZZLED_ITEM_CMPFUNC_H */