diff options
author | unknown <evgen@moonbone.local> | 2007-01-11 16:45:38 +0300 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-01-11 16:45:38 +0300 |
commit | 52c100ae0cfbf5588fe3fa1917aba3934241e3f6 (patch) | |
tree | 34f917f8b95414b540f86d33b2f29d88a5c28feb /sql/item_strfunc.h | |
parent | 0fdd3dce16caf33148bcc42b98b5d5d6142182f6 (diff) | |
download | mariadb-git-52c100ae0cfbf5588fe3fa1917aba3934241e3f6.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.
mysql-test/t/func_str.test:
Added a test case for bug#23409: Arguments of the ENCODE() and the
> DECODE() functionswere not printed correctly.
mysql-test/r/func_str.result:
Added a test case for bug#23409: Arguments of the ENCODE() and the DECODE() functions were not printed correctly.
sql/item_strfunc.h:
Bug#23409: Arguments of the ENCODE() and the DECODE() functions were not printed correctly.
The print() method is added to the Item_func_encode class.
sql/item_strfunc.cc:
Bug#23409: Arguments of the ENCODE() and the DECODE() functions were not printed correctly.
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.h | 11 |
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"; } }; |