diff options
author | unknown <konstantin@mysql.com> | 2005-03-21 12:57:42 +0300 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2005-03-21 12:57:42 +0300 |
commit | 35e6a4b418f46cb6197ff7c4bd6b5eb19261fdaf (patch) | |
tree | 2e18e29782b6b8cc38a521cc10b0792c8dfdf43e /strings | |
parent | 2ba3544f0e053d95e82b9a899fd9b86cbb19b9ce (diff) | |
download | mariadb-git-35e6a4b418f46cb6197ff7c4bd6b5eb19261fdaf.tar.gz |
Fix a valgrind warning in decimal.c:sanity()
sql/my_decimal.h:
Refixing the valgrind warning in decimal.c:sanity() in a different way
(as requested by Monty): we want to let valgrind see uninitialized
memory whenever it's possible.
strings/decimal.c:
Fix sanity() to not look into possibly uninitialized memory if
HAVE_purify.
Diffstat (limited to 'strings')
-rw-r--r-- | strings/decimal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c index 90e64ae892f..f288a93eb5e 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -139,8 +139,12 @@ static const dec1 frac_max[DIG_PER_DEC1-1]={ 999900000, 999990000, 999999000, 999999900, 999999990 }; +#ifdef HAVE_purify +#define sanity(d) DBUG_ASSERT((d)->len > 0) +#else #define sanity(d) DBUG_ASSERT((d)->len >0 && ((d)->buf[0] | \ (d)->buf[(d)->len-1] | 1)) +#endif #define FIX_INTG_FRAC_ERROR(len, intg1, frac1, error) \ do \ |