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.
This commit is contained in:
unknown 2007-01-11 16:45:38 +03:00
commit 52c100ae0c
4 changed files with 42 additions and 4 deletions

View file

@ -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);