summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2003-06-26 15:07:42 +0300
committerbell@sanja.is.com.ua <>2003-06-26 15:07:42 +0300
commit6f81b7e027c1ed78644321b0070030356ee23f44 (patch)
treeb26a72bdf2d05941180cd1684ae2fa585b967eaa /sql/item.cc
parente8b1e216155d51b5b7ca64f2f7335e50b1c9c538 (diff)
downloadmariadb-git-6f81b7e027c1ed78644321b0070030356ee23f44.tar.gz
Item::str_value can't be used for storing value
(fixed error in Item_cache_str)
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 804963b4c9a..755bcc5c77b 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1630,11 +1630,11 @@ Item_cache* Item_cache::get_cache(Item_result type)
void Item_cache_str::store(Item *item)
{
- str_value.set(buffer, sizeof(buffer), item->charset());
- value= item->str_result(&str_value);
+ value_buff.set(buffer, sizeof(buffer), item->charset());
+ value= item->str_result(&value_buff);
if ((null_value= item->null_value))
value= 0;
- else if (value != &str_value)
+ else if (value != &value_buff)
{
/*
We copy string value to avoid changing value if 'item' is table field
@@ -1644,10 +1644,10 @@ void Item_cache_str::store(Item *item)
(select c from t1 where a=t2.a)
from t2;
*/
- str_value.copy(*value);
- value= &str_value;
+ value_buff.copy(*value);
+ value= &value_buff;
}
-
+ set_charset(&item->collation);
}
double Item_cache_str::val()
{