Small fix for Field_str::store() to avoid trying to read past beginning

of log_10 array.
This commit is contained in:
jimw@mysql.com 2005-01-13 00:52:19 +01:00
parent 51781b0bfc
commit 0a3fba7f18

View file

@ -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;