~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.h

  • Committer: Monty Taylor
  • Date: 2008-11-16 23:47:43 UTC
  • mto: (584.1.10 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116234743-c38gmv0pa2kdefaj
BrokeĀ outĀ cached_item.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <drizzled/dtcollation.h>
24
24
 
25
 
#define NO_CACHED_FIELD_INDEX ((uint)(-1))
26
 
 
27
25
class Protocol;
28
26
class TableList;
29
27
class Item_field;
643
641
  bool alias_name_used; /* true if item was resolved against alias */
644
642
  /* 
645
643
    Cached value of index for this field in table->field array, used by prep. 
646
 
    stmts for speeding up their re-execution. Holds NO_CACHED_FIELD_INDEX 
 
644
    stmts for speeding up their re-execution. Holds NO_CACHED_FIELD_INDEX
647
645
    if index value is not known.
648
646
  */
649
647
  uint32_t cached_field_index;
1757
1755
  bool const_item() const { return 0; }
1758
1756
  bool is_null() { return null_value; }
1759
1757
};
1760
 
 
1761
 
 
1762
 
class Cached_item :public Sql_alloc
1763
 
{
1764
 
public:
1765
 
  bool null_value;
1766
 
  Cached_item() :null_value(0) {}
1767
 
  virtual bool cmp(void)=0;
1768
 
  virtual ~Cached_item(); /*line -e1509 */
1769
 
};
1770
 
 
1771
 
class Cached_item_str :public Cached_item
1772
 
{
1773
 
  Item *item;
1774
 
  String value,tmp_value;
1775
 
public:
1776
 
  Cached_item_str(Session *session, Item *arg);
1777
 
  bool cmp(void);
1778
 
  ~Cached_item_str();                           // Deallocate String:s
1779
 
};
1780
 
 
1781
 
 
1782
 
class Cached_item_real :public Cached_item
1783
 
{
1784
 
  Item *item;
1785
 
  double value;
1786
 
public:
1787
 
  Cached_item_real(Item *item_par) :item(item_par),value(0.0) {}
1788
 
  bool cmp(void);
1789
 
};
1790
 
 
1791
 
class Cached_item_int :public Cached_item
1792
 
{
1793
 
  Item *item;
1794
 
  int64_t value;
1795
 
public:
1796
 
  Cached_item_int(Item *item_par) :item(item_par),value(0) {}
1797
 
  bool cmp(void);
1798
 
};
1799
 
 
1800
 
 
1801
 
class Cached_item_decimal :public Cached_item
1802
 
{
1803
 
  Item *item;
1804
 
  my_decimal value;
1805
 
public:
1806
 
  Cached_item_decimal(Item *item_par);
1807
 
  bool cmp(void);
1808
 
};
1809
 
 
1810
 
class Cached_item_field :public Cached_item
1811
 
{
1812
 
  unsigned char *buff;
1813
 
  Field *field;
1814
 
  uint32_t length;
1815
 
 
1816
 
public:
1817
 
  Cached_item_field(Field *arg_field) : field(arg_field)
1818
 
  {
1819
 
    field= arg_field;
1820
 
    /* TODO: take the memory allocation below out of the constructor. */
1821
 
    buff= (unsigned char*) sql_calloc(length=field->pack_length());
1822
 
  }
1823
 
  bool cmp(void);
1824
 
};
1825
 
 
1826
1758
class Item_default_value : public Item_field
1827
1759
{
1828
1760
public:
2036
1968
                                    Field *found_field, Item *found_item,
2037
1969
                                    Item_ident *resolved_item);
2038
1970
 
2039
 
extern Cached_item *new_Cached_item(Session *session, Item *item,
2040
 
                                    bool use_result_field);
2041
1971
extern void resolve_const_item(Session *session, Item **ref, Item *cmp_item);
2042
1972
extern bool field_is_equal_to_item(Field *field,Item *item);
2043
1973