diff options
Diffstat (limited to 'libmysql/libmysql.c')
-rw-r--r-- | libmysql/libmysql.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 2e10060f1d3..c7bdfc4c42c 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3876,7 +3876,19 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, sprintf(buff, "%.*f", (int) field->decimals, value); end= strend(buff); } - fetch_string_with_conversion(param, buff, (uint) (end - buff)); + + { + size_t length= end - buff; + if (field->flags & ZEROFILL_FLAG && length < field->length && + field->length < MAX_DOUBLE_STRING_REP_LENGTH - 1) + { + bmove_upp((char*) buff + field->length, buff + length, length); + bfill((char*) buff, field->length - length, '0'); + length= field->length; + } + fetch_string_with_conversion(param, buff, length); + } + break; } } |