summaryrefslogtreecommitdiff
path: root/sql/my_decimal.h
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-08-29 11:24:36 +0200
committerTor Didriksen <tor.didriksen@oracle.com>2011-08-29 11:24:36 +0200
commitf610c5658748ae97a5e2c1e1afbd229f2121a082 (patch)
treecfdb33c49ffc624e6202046c039fea6682c55126 /sql/my_decimal.h
parent5618a7d69df06ee7ad3b41a269cba8b57f99a8c5 (diff)
downloadmariadb-git-f610c5658748ae97a5e2c1e1afbd229f2121a082.tar.gz
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. include/decimal.h: Document struct st_decimal_t mysql-test/r/type_newdecimal.result: New test case (valgrind warnings) mysql-test/t/type_newdecimal.test: New test case (valgrind warnings) sql/my_decimal.h: Remove the HAVE_purify enabled/disabled code. strings/decimal.c: Make a proper zero, with non-zero precision.
Diffstat (limited to 'sql/my_decimal.h')
-rw-r--r--sql/my_decimal.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index c7a99e10233..21f485560da 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -101,12 +101,8 @@ public:
{
len= DECIMAL_BUFF_LENGTH;
buf= buffer;
-#if !defined (HAVE_purify) && !defined(DBUG_OFF)
- /* Set buffer to 'random' value to find wrong buffer usage */
- for (uint i= 0; i < DECIMAL_BUFF_LENGTH; i++)
- buffer[i]= i;
-#endif
}
+
my_decimal()
{
init();