diff options
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/item.h b/sql/item.h index a1c7f2e16f1..2ad85832747 100644 --- a/sql/item.h +++ b/sql/item.h @@ -419,6 +419,7 @@ public: int save_in_field(Field *field, bool no_conversions); bool basic_const_item() const { return 1; } Item *new_item() { return new Item_int(name,value,max_length); } + void cleanup() { fixed= 1; } // to privent drop fixed flag void print(String *str); }; @@ -906,6 +907,8 @@ public: enum Type type() const { return CACHE_ITEM; } static Item_cache* get_cache(Item_result type); table_map used_tables() const { return used_table_map; } + virtual void keep_array() {} + void cleanup() { fixed= 1; } // to privent drop fixed flag void print(String *str); }; @@ -958,8 +961,10 @@ class Item_cache_row: public Item_cache { Item_cache **values; uint item_count; + bool save_array; public: - Item_cache_row(): Item_cache(), values(0), item_count(2) {} + Item_cache_row() + :Item_cache(), values(0), item_count(2), save_array(0) {} /* 'allocate' used only in row transformer, to preallocate space for row @@ -1000,11 +1005,15 @@ public: bool check_cols(uint c); bool null_inside(); void bring_value(); + void keep_array() { save_array= 1; } void cleanup() { DBUG_ENTER("Item_cache_row::cleanup"); Item_cache::cleanup(); - values= 0; + if (save_array) + bzero(values, item_count*sizeof(Item**)); + else + values= 0; DBUG_VOID_RETURN; } }; |