Commit 7682d6c9 authored by unknown's avatar unknown

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

of log_10 array.


sql/field.cc:
  Avoid pointless calculation for really short fields, and what could be
  an attempt to access outside the bounds of the log_10 array.
parent 8b077c2b
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment