summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2007-01-11 16:45:38 +0300
committerevgen@moonbone.local <>2007-01-11 16:45:38 +0300
commitfc0e206cb538d622abf1854a50a14836ac275b74 (patch)
tree34f917f8b95414b540f86d33b2f29d88a5c28feb /sql/item_strfunc.cc
parentf35e10d43ca61eff7631d9ba95a4d9c4012f40b0 (diff)
downloadmariadb-git-fc0e206cb538d622abf1854a50a14836ac275b74.tar.gz
Bug#23409: Arguments of the ENCODE() and the DECODE() functions were not printed
correctly. The Item_func::print method was used to print the Item_func_encode and the Item_func_decode objects. The last argument to ENCODE and DECODE functions is a plain C string and thus Item_func::print wasn't able to print it. The print() method is added to the Item_func_encode class. It correctly prints the Item_func_encode and the Item_func_decode objects.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index f7408cb5e9f..7c98f0c6380 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1583,6 +1583,19 @@ String *Item_func_encode::val_str(String *str)
return res;
}
+void Item_func_encode::print(String *str)
+{
+ str->append(func_name());
+ str->append('(');
+ args[0]->print(str);
+ str->append(',');
+ str->append('\'');
+ str->append(seed);
+ str->append('\'');
+ str->append(')');
+}
+
+
String *Item_func_decode::val_str(String *str)
{
DBUG_ASSERT(fixed == 1);