summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-01-13 00:52:19 +0100
committerjimw@mysql.com <>2005-01-13 00:52:19 +0100
commit0a3fba7f182407755d217c10df7353614c09348d (patch)
tree9f8ef6b6c536ca7d3ea861b235140c545bf98fca /sql/field.cc
parent51781b0bfcf092d5c347d59b587bb0b7aa08bfa5 (diff)
downloadmariadb-git-0a3fba7f182407755d217c10df7353614c09348d.tar.gz
Small fix for Field_str::store() to avoid trying to read past beginning
of log_10 array.
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 2f2115e55dd..fec65438e4d 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4307,7 +4307,7 @@ int Field_str::store(double nr)
*/
double anr= fabs(nr);
int neg= (nr < 0.0) ? 1 : 0;
- if (field_length < 32 &&
+ if (field_length > 4 && field_length < 32 &&
(anr < 1.0 ? anr > 1/(log_10[max(0,field_length-neg-2)]) /* -2 for "0." */
: anr < log_10[field_length-neg]-1))
use_scientific_notation= FALSE;