diff options
author | kostja@bodhi.local <> | 2006-08-30 03:00:19 +0400 |
---|---|---|
committer | kostja@bodhi.local <> | 2006-08-30 03:00:19 +0400 |
commit | ebb70704303ef3f7e227e8102d8eb4b466bdd9e4 (patch) | |
tree | 844b46ab5d82eec374f925e63be3812e697f87e3 /sql/item_strfunc.cc | |
parent | 0368914b9a22891e9eac2b8a77dfbe43ea80c820 (diff) | |
parent | 3bf609b7f2b73555b1e241dc7c354818b0bbbc5a (diff) | |
download | mariadb-git-ebb70704303ef3f7e227e8102d8eb4b466bdd9e4.tar.gz |
Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 23c7cb4c3d8..73a56fb34e9 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2051,6 +2051,26 @@ String *Item_func_make_set::val_str(String *str) } +Item *Item_func_make_set::transform(Item_transformer transformer, byte *arg) +{ + DBUG_ASSERT(!current_thd->is_stmt_prepare()); + + Item *new_item= item->transform(transformer, arg); + if (!new_item) + return 0; + + /* + THD::change_item_tree() should be called only if the tree was + really transformed, i.e. when a new item has been created. + Otherwise we'll be allocating a lot of unnecessary memory for + change records at each execution. + */ + if (item != new_item) + current_thd->change_item_tree(&item, new_item); + return Item_str_func::transform(transformer, arg); +} + + void Item_func_make_set::print(String *str) { str->append(STRING_WITH_LEN("make_set(")); |