Fix QUOTE() to not reuse the input field for output, which resulted in

incorrect results when the input was a constant across a multi-row SELECT
statement. (Bug #8248)


sql/item_strfunc.h:
  Add tmp_value member
sql/item_strfunc.cc:
  Always allocate a new string for QUOTE(), in case the field is being reused
  for multiple rows.
mysql-test/t/func_str.test:
  Add regression test
mysql-test/r/func_str.result:
  Add test results
This commit is contained in:
unknown 2005-02-01 18:29:10 -08:00
commit 6d0d03dab9
4 changed files with 18 additions and 10 deletions

View file

@ -535,6 +535,7 @@ public:
class Item_func_quote :public Item_str_func
{
String tmp_value;
public:
Item_func_quote(Item *a) :Item_str_func(a) {}
const char *func_name() const { return "quote"; }