diff options
author | unknown <serg@serg.mylan> | 2004-08-19 23:11:16 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-08-19 23:11:16 +0200 |
commit | d1c5ca31f615592f62280ef2d005fa1201541027 (patch) | |
tree | a3aeaec255a5d5a0e7ff06fdc3ec4a68115fa9ea /sql | |
parent | 03a20c23b320bb28a13aa6dc69c9445ff414a144 (diff) | |
parent | 432a0f36838f0c68d5db3087bf3331ff9df1460b (diff) | |
download | mariadb-git-d1c5ca31f615592f62280ef2d005fa1201541027.tar.gz |
Merge bk-internal:/home/bk/mysql-4.0/
into serg.mylan:/usr/home/serg/Abk/mysql-4.0
Diffstat (limited to 'sql')
-rw-r--r-- | sql/field.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc index 1b5c688fe7a..71ec7545efc 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -3733,15 +3733,17 @@ static void store_double_in_string_field(Field_str *field, uint32 field_length, use_scientific_notation= (field->ceiling < nr); } length= (uint)sprintf(buff, "%-.*g", - use_scientific_notation ? max(0,field_length-5) : field_length, + use_scientific_notation ? max(0,(int)field_length-5) : field_length, nr); /* +1 below is because "precision" in %g above means the max. number of significant digits, not the output width. Thus the width can be larger than number of significant digits by 1 (for decimal point) + the test for field_length < 5 is for extreme cases, + like inserting 500.0 in char(1) */ - DBUG_ASSERT(length <= field_length+1); + DBUG_ASSERT(field_length < 5 || length <= field_length+1); field->store(buff, min(length, field_length)); } |