00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 namespace drizzled
00023 {
00024
00025 typedef struct st_typelib TYPELIB;
00026 class String;
00027 namespace type {
00028 class Decimal;
00029 }
00030 class Session;
00031 class Item;
00032
00033
00034
00035
00036
00037
00038
00039
00040 class Item_type_holder: public Item
00041 {
00042 protected:
00043 TYPELIB *enum_set_typelib;
00044 enum_field_types fld_type;
00045
00052 void get_full_info(Item *item);
00053
00054
00055 int prev_decimal_int_part;
00056 public:
00057 Item_type_holder(Session *session, Item *item);
00058
00065 Item_result result_type() const;
00066
00067 enum_field_types field_type() const { return fld_type; };
00068 enum Type type() const { return TYPE_HOLDER; }
00069 double val_real();
00070 int64_t val_int();
00071 type::Decimal *val_decimal(type::Decimal *val);
00072 String *val_str(String* val);
00073
00086 bool join_types(Session *session, Item *item);
00087
00097 Field *make_field_by_type(Table *table);
00098
00107 static uint32_t display_length(Item *item);
00108
00115 static enum_field_types get_real_type(Item *item);
00116 };
00117
00118 }
00119