summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.h
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.h
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.h')
-rw-r--r--sql/item_strfunc.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index b7cecad9516..4bd8574ff04 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -343,19 +343,24 @@ class Item_func_encode :public Item_str_func
{
protected:
SQL_CRYPT sql_crypt;
+ String seed;
public:
- Item_func_encode(Item *a, char *seed):
- Item_str_func(a),sql_crypt(seed) {}
+ Item_func_encode(Item *a, char *seed_arg):
+ Item_str_func(a), sql_crypt(seed_arg)
+ {
+ seed.copy(seed_arg, strlen(seed_arg), default_charset_info);
+ }
String *val_str(String *);
void fix_length_and_dec();
const char *func_name() const { return "encode"; }
+ void print(String *str);
};
class Item_func_decode :public Item_func_encode
{
public:
- Item_func_decode(Item *a, char *seed): Item_func_encode(a,seed) {}
+ Item_func_decode(Item *a, char *seed_arg): Item_func_encode(a, seed_arg) {}
String *val_str(String *);
const char *func_name() const { return "decode"; }
};