summaryrefslogtreecommitdiff
path: root/sql/my_decimal.cc
diff options
context:
space:
mode:
authorSergey Glukhov <sergey.glukhov@oracle.com>2010-12-14 19:08:25 +0300
committerSergey Glukhov <sergey.glukhov@oracle.com>2010-12-14 19:08:25 +0300
commit622ae4184cb3e691bbb3346f0d9079a45799bbce (patch)
treeeb9266e1f7523ad256a18bfea6203ab7e7fe2ed2 /sql/my_decimal.cc
parent6e3314b078f30fa5533a0d59eca65a49377e8528 (diff)
downloadmariadb-git-622ae4184cb3e691bbb3346f0d9079a45799bbce.tar.gz
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.
Diffstat (limited to 'sql/my_decimal.cc')
-rw-r--r--sql/my_decimal.cc1
1 files changed, 1 insertions, 0 deletions
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);
}