diff options
author | Annamalai Gurusami <annamalai.gurusami@oracle.com> | 2013-02-22 15:15:14 +0530 |
---|---|---|
committer | Annamalai Gurusami <annamalai.gurusami@oracle.com> | 2013-02-22 15:15:14 +0530 |
commit | 64c5c5cbfcf87a0d68adf664f63bd9858f6c6a63 (patch) | |
tree | bd4db2602dea724fe5db8ef7631bf1ed7ce9a55c /sql/set_var.h | |
parent | f325fc42e83baebd8420449cd3e80974a6bb9ee0 (diff) | |
parent | dc6969734afbd6598035c81a3e0a7f139083ed65 (diff) | |
download | mariadb-git-64c5c5cbfcf87a0d68adf664f63bd9858f6c6a63.tar.gz |
Merge from mysql-5.1 to mysql-5.5
Diffstat (limited to 'sql/set_var.h')
-rw-r--r-- | sql/set_var.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sql/set_var.h b/sql/set_var.h index f0d90cb0d63..fc0c5004b5b 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -225,13 +225,23 @@ public: if (value_arg && value_arg->type() == Item::FIELD_ITEM) { Item_field *item= (Item_field*) value_arg; - if (!(value=new Item_string(item->field_name, - (uint) strlen(item->field_name), - system_charset_info))) // names are utf8 - value=value_arg; /* Give error message later */ + if (item->field_name) + { + if (!(value= new Item_string(item->field_name, + (uint) strlen(item->field_name), + system_charset_info))) // names are utf8 + value= value_arg; /* Give error message later */ + } + else + { + /* Both Item_field and Item_insert_value will return the type as + Item::FIELD_ITEM. If the item->field_name is NULL, we assume the + object to be Item_insert_value. */ + value= value_arg; + } } else - value=value_arg; + value= value_arg; } int check(THD *thd); int update(THD *thd); |