~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item.h

  • Committer: Monty Taylor
  • Date: 2008-11-17 23:20:25 UTC
  • mto: (589.1.3 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081117232025-01m5jfd4l9cn93kb
Removed field.h from common_includes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#define DRIZZLED_ITEM_H
22
22
 
23
23
#include <drizzled/dtcollation.h>
 
24
#include <mysys/drizzle_time.h>
 
25
#include <drizzled/my_decimal.h>
24
26
 
25
27
class Protocol;
26
28
class TableList;
32
34
class user_var_entry;
33
35
class Item_sum;
34
36
class Item_in_subselect;
35
 
 
 
37
class Send_field;
36
38
 
37
39
void item_init(void);                   /* Init item functions */
38
40
 
385
387
  inline uint32_t float_length(uint32_t decimals_par) const
386
388
  { return decimals != NOT_FIXED_DEC ? (DBL_DIG+2+decimals_par) : DBL_DIG+8;}
387
389
  virtual uint32_t decimal_precision() const;
388
 
  inline int decimal_int_part() const
389
 
  { return my_decimal_int_part(decimal_precision(), decimals); }
 
390
  int decimal_int_part() const;
 
391
 
390
392
  /*
391
393
    Returns true if this is constant (during query execution, i.e. its value
392
394
    will not change until next fix_fields) and its value is known.
682
684
  {}
683
685
 
684
686
  enum Type type() const { return FIELD_ITEM; }
685
 
  double val_real() { return field->val_real(); }
686
 
  int64_t val_int() { return field->val_int(); }
687
 
  String *val_str(String *str) { return field->val_str(str); }
688
 
  my_decimal *val_decimal(my_decimal *dec) { return field->val_decimal(dec); }
 
687
  double val_real();
 
688
  int64_t val_int();
 
689
  String *val_str(String *str);
 
690
  my_decimal *val_decimal(my_decimal *dec);
689
691
  void make_field(Send_field *tmp_field);
690
692
};
691
693
 
743
745
  int save_in_field(Field *field,bool no_conversions);
744
746
  void save_org_in_field(Field *field);
745
747
  table_map used_tables() const;
746
 
  enum Item_result result_type () const
747
 
  {
748
 
    return field->result_type();
749
 
  }
750
 
  Item_result cast_to_int_type() const
751
 
  {
752
 
    return field->cast_to_int_type();
753
 
  }
754
 
  enum_field_types field_type() const
755
 
  {
756
 
    return field->type();
757
 
  }
 
748
  enum Item_result result_type () const;
 
749
  Item_result cast_to_int_type() const;
 
750
  enum_field_types field_type() const;
758
751
  enum_monotonicity_info get_monotonicity_info() const
759
752
  {
760
753
    return MONOTONIC_STRICT_INCREASING;
765
758
  bool get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
766
759
  bool get_date_result(DRIZZLE_TIME *ltime,uint32_t fuzzydate);
767
760
  bool get_time(DRIZZLE_TIME *ltime);
768
 
  bool is_null() { return field->is_null(); }
 
761
  bool is_null();
769
762
  void update_null_value();
770
763
  Item *get_tmp_table_item(Session *session);
771
764
  bool collect_item_field_processor(unsigned char * arg);
775
768
  bool check_vcol_func_processor(unsigned char *arg __attribute__((unused)))
776
769
  { return false; }
777
770
  void cleanup();
778
 
  bool result_as_int64_t()
779
 
  {
780
 
    return field->can_be_compared_as_int64_t();
781
 
  }
 
771
  bool result_as_int64_t();
782
772
  Item_equal *find_item_equal(COND_EQUAL *cond_equal);
783
773
  bool subst_argument_checker(unsigned char **arg);
784
774
  Item *equal_fields_propagator(unsigned char *arg);
785
775
  bool set_no_const_sub(unsigned char *arg);
786
776
  Item *replace_equal_field(unsigned char *arg);
787
 
  inline uint32_t max_disp_length() { return field->max_display_length(); }
 
777
  uint32_t max_disp_length();
788
778
  Item_field *filed_for_view_update() { return this; }
789
779
  Item *safe_charset_converter(const CHARSET_INFO * const tocs);
790
780
  int fix_outer_field(Session *session, Field **field, Item **reference);
1873
1863
  table_map used_tables() const { return used_table_map; }
1874
1864
  virtual void keep_array() {}
1875
1865
  virtual void print(String *str, enum_query_type query_type);
1876
 
  bool eq_def(Field *field) 
1877
 
  { 
1878
 
    return cached_field ? cached_field->eq_def (field) : false;
1879
 
  }
 
1866
  bool eq_def(Field *field);
1880
1867
  bool eq(const Item *item,
1881
1868
          bool binary_cmp __attribute__((unused))) const
1882
1869
  {
1943
1930
  bool is_varbinary;
1944
1931
 
1945
1932
public:
1946
 
  Item_cache_str(const Item *item) :
1947
 
    Item_cache(), value(0),
1948
 
    is_varbinary(item->type() == FIELD_ITEM &&
1949
 
                 ((const Item_field *) item)->field->type() ==
1950
 
                   DRIZZLE_TYPE_VARCHAR &&
1951
 
                 !((const Item_field *) item)->field->has_charset())
1952
 
  {}
 
1933
  Item_cache_str(const Item *item);
1953
1934
  void store(Item *item);
1954
1935
  double val_real();
1955
1936
  int64_t val_int();