summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-06-12 10:53:14 +0200
committerunknown <msvensson@neptunus.(none)>2006-06-12 10:53:14 +0200
commit2fbebfec1df2c72bfd33516b9da20181124b22f5 (patch)
tree80e1cd69d392fefaed1665328433ea107b6d91e7 /libmysql
parent2dd1dc62462a9b7348d1c815acacddedb5a62d88 (diff)
parentf3c9a47517147dd447f7e668fd1d97c22e2d737a (diff)
downloadmariadb-git-2fbebfec1df2c72bfd33516b9da20181124b22f5.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/bug11589/my50-bug11589
into neptunus.(none):/home/msvensson/mysql/bug11589/my50-test_latest libmysql/libmysql.c: Auto merged mysql-test/r/type_float.result: Auto merged mysql-test/t/type_float.test: Auto merged
Diffstat (limited to 'libmysql')
-rw-r--r--libmysql/libmysql.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index c1e0703af10..69d86899ab4 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -3827,7 +3827,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;
}
}