From 0a3fba7f182407755d217c10df7353614c09348d Mon Sep 17 00:00:00 2001 From: "jimw@mysql.com" <> Date: Thu, 13 Jan 2005 00:52:19 +0100 Subject: [PATCH] Small fix for Field_str::store() to avoid trying to read past beginning of log_10 array. --- sql/field.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;