1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

merge 5.1 => 5.5

This commit is contained in:
Tor Didriksen
2011-08-29 11:34:48 +02:00
5 changed files with 43 additions and 6 deletions

View File

@ -1403,11 +1403,18 @@ int bin2decimal(const uchar *from, decimal_t *to, int precision, int scale)
buf++;
}
my_afree(d_copy);
/*
No digits? We have read the number zero, of unspecified precision.
Make it a proper zero, with non-zero precision.
*/
if (to->intg == 0 && to->frac == 0)
decimal_make_zero(to);
return error;
err:
my_afree(d_copy);
decimal_make_zero(((decimal_t*) to));
decimal_make_zero(to);
return(E_DEC_BAD_NUM);
}