summaryrefslogtreecommitdiff
path: root/libmysql
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.mysql.com>2007-10-15 10:59:01 +0200
committerunknown <msvensson@pilot.mysql.com>2007-10-15 10:59:01 +0200
commit70ee3aa75fada72b193797e26496c91906f4cbf8 (patch)
tree5451670f8a7266ace1ef9b98c103daf46604a28b /libmysql
parent8b7ee0d67aa1d43b229b10b56c5a9362571c5802 (diff)
parent13afffd03b80ab73d813158f3d0a1ebf63a5ef31 (diff)
downloadmariadb-git-70ee3aa75fada72b193797e26496c91906f4cbf8.tar.gz
Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.0-maint
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-new-maint 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 8ccf7b7d5e2..bbd781172e2 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -3873,7 +3873,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;
}
}