summaryrefslogtreecommitdiff
path: root/sql/item.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item.h')
-rw-r--r--sql/item.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/sql/item.h b/sql/item.h
index 55c9af356a8..0a2be74c76c 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -389,7 +389,7 @@ public:
FALSE value is false or NULL
TRUE value is true (not equal to 0)
*/
- bool val_bool();
+ virtual bool val_bool();
/* Helper functions, see item_sum.cc */
String *val_string_from_real(String *str);
String *val_string_from_int(String *str);
@@ -882,6 +882,7 @@ public:
bool get_time(TIME *tm);
bool get_date(TIME *tm, uint fuzzydate);
int save_in_field(Field *field, bool no_conversions);
+ bool fix_fields(THD *, struct st_table_list *, Item **);
void set_null();
void set_int(longlong i, uint32 max_length_arg);
@@ -1782,33 +1783,33 @@ public:
/*
- Used to store type. name, length of Item for UNIONS & derived table
+ Item_type_holder used to store type. name, length of Item for UNIONS &
+ derived tables.
+
+ Item_type_holder do not need cleanup() because its time of live limited by
+ single SP/PS execution.
*/
class Item_type_holder: public Item
{
protected:
- Item_result item_type;
- Item_result orig_type;
- Field *field_example;
+ TYPELIB *enum_set_typelib;
+ enum_field_types fld_type;
+
+ void get_full_info(Item *item);
public:
- Item_type_holder(THD*, Item*, TABLE *);
+ Item_type_holder(THD*, Item*);
- Item_result result_type () const { return item_type; }
+ Item_result result_type() const;
+ virtual enum_field_types field_type() const { return fld_type; };
enum Type type() const { return TYPE_HOLDER; }
double val_real();
longlong val_int();
my_decimal *val_decimal(my_decimal *);
String *val_str(String*);
- bool join_types(THD *thd, Item *, TABLE *);
- Field *example() { return field_example; }
- static uint32 real_length(Item *item);
- void cleanup()
- {
- DBUG_ENTER("Item_type_holder::cleanup");
- Item::cleanup();
- item_type= orig_type;
- DBUG_VOID_RETURN;
- }
+ bool join_types(THD *thd, Item *);
+ Field *make_field_by_type(TABLE *table);
+ static uint32 display_length(Item *item);
+ static enum_field_types get_real_type(Item *);
};