diff options
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sql/item.h b/sql/item.h index 7693a2ffec7..b98389bc8d4 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1242,11 +1242,13 @@ class Item_name_const : public Item { Item *value_item; Item *name_item; + bool valid_args; public: Item_name_const(Item *name_arg, Item *val): value_item(val), name_item(name_arg) { - if(!value_item->basic_const_item()) + if (!(valid_args= name_item->basic_const_item() & + value_item->basic_const_item())) my_error(ER_WRONG_ARGUMENTS, MYF(0), "NAME_CONST"); Item::maybe_null= TRUE; } @@ -2627,10 +2629,19 @@ protected: For all other uses of Item_cache, cached_field doesn't matter. */ Field *cached_field; + enum enum_field_types cached_field_type; public: - Item_cache(): example(0), used_table_map(0), cached_field(0) + Item_cache(): + example(0), used_table_map(0), cached_field(0), cached_field_type(MYSQL_TYPE_STRING) { - fixed= 1; null_value= 1; + fixed= 1; + null_value= 1; + } + Item_cache(enum_field_types field_type_arg): + example(0), used_table_map(0), cached_field(0), cached_field_type(field_type_arg) + { + fixed= 1; + null_value= 1; } void set_used_tables(table_map map) { used_table_map= map; } @@ -2649,6 +2660,7 @@ public: }; virtual void store(Item *)= 0; enum Type type() const { return CACHE_ITEM; } + enum_field_types field_type() const { return cached_field_type; } static Item_cache* get_cache(const Item *item); table_map used_tables() const { return used_table_map; } virtual void keep_array() {} @@ -2672,6 +2684,8 @@ protected: longlong value; public: Item_cache_int(): Item_cache(), value(0) {} + Item_cache_int(enum_field_types field_type_arg): + Item_cache(field_type_arg), value(0) {} void store(Item *item); void store(Item *item, longlong val_arg); |