From 76627d5fc33749cb329a6ced6ce8ba16a3bdd558 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Tue, 14 Dec 2010 19:08:25 +0300 Subject: Bug#57818 string conversion function died Bug#57913 large negative number to string conversion functions crash String object which is used as result container of the item has uninitialized 'str_charset' field. This object might be used later to preform some internal operations and str_charset field is involved in these operations. It leads to crash. The fix is to intialize str_charset in my_decimal2string() func. mysql-test/r/func_str.result: test case mysql-test/t/func_str.test: test case sql/my_decimal.cc: intialize str_charset field for result string in my_decimal2string() func. --- sql/my_decimal.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/my_decimal.cc') diff --git a/sql/my_decimal.cc b/sql/my_decimal.cc index 3aa01880b83..26377bc1562 100644 --- a/sql/my_decimal.cc +++ b/sql/my_decimal.cc @@ -109,6 +109,7 @@ int my_decimal2string(uint mask, const my_decimal *d, result= decimal2string((decimal_t*) d, (char*) str->ptr(), &length, (int)fixed_prec, fixed_dec, filler); + str->set_charset(&my_charset_bin); str->length(length); return check_result(mask, result); } -- cgit v1.2.1