1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +03:00

BUG#12911710 - VALGRIND FAILURE IN ROW-DEBUG:PERFSCHEMA.SOCKET_SUMMARY_BY_INSTANCE_FUNC

Converting the number zero to binary and back yielded the number zero,
but with no digits, i.e. zero precision.
This made the multiply algorithm go haywire in various ways.
This commit is contained in:
Tor Didriksen
2011-08-29 11:24:36 +02:00
parent dc7bc64483
commit 4bcf506530
5 changed files with 43 additions and 6 deletions

View File

@ -1423,11 +1423,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);
}