diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-10-29 15:25:18 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-10-29 15:25:18 +0300 |
commit | 7de8306c19f628ec85289861f066d143aaf67c8c (patch) | |
tree | d5c3e4c874e3a2401741faf1f68bb22e8b7dec7a /sql/item_strfunc.cc | |
parent | 982b18f53e5d4ce6cfd4c87a4e72f92e9e1ff3d8 (diff) | |
parent | c3f923857a1cfcec4f1d037b20427931f8fe9a51 (diff) | |
download | mariadb-git-7de8306c19f628ec85289861f066d143aaf67c8c.tar.gz |
merge
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d8a21b5a4a2..6d8a113d4a4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2313,7 +2313,8 @@ String *Item_func_format::val_str_ascii(String *str) if (lc->grouping[0] > 0 && str_length >= dec_length + 1 + lc->grouping[0]) { - char buf[DECIMAL_MAX_STR_LENGTH * 2]; /* 2 - in the worst case when grouping=1 */ + /* We need space for ',' between each group of digits as well. */ + char buf[2 * FLOATING_POINT_BUFFER]; int count; const char *grouping= lc->grouping; char sign_length= *str->ptr() == '-' ? 1 : 0; @@ -2337,7 +2338,7 @@ String *Item_func_format::val_str_ascii(String *str) count will be initialized to -1 and we'll never get into this "if" anymore. */ - if (!count) + if (count == 0) { *--dst= lc->thousand_sep; if (grouping[1]) |