diff options
author | msvensson@pilot.mysql.com <> | 2007-10-15 09:22:11 +0200 |
---|---|---|
committer | msvensson@pilot.mysql.com <> | 2007-10-15 09:22:11 +0200 |
commit | cecc37d8b469165f6aa49f0d642e91de4661e2f3 (patch) | |
tree | 3de11e8fde7659d77c1b9e980c52e129ebb2a925 /libmysql | |
parent | 583f5080c427fd503c88a6738c47a1730016c712 (diff) | |
parent | dfc401705d43268da2ecafc4c797b2b66da518f4 (diff) | |
download | mariadb-git-cecc37d8b469165f6aa49f0d642e91de4661e2f3.tar.gz |
Merge pilot.mysql.com:/data/msvensson/mysql/bug11589/my50-test_latest
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.0-maint
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 2e10060f1d3..2a92d115ee2 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3876,7 +3876,15 @@ 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)); + uint length= (uint) (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; } } |