summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorholyfoot@hf-ibm.(none) <>2005-05-07 14:41:00 +0500
committerholyfoot@hf-ibm.(none) <>2005-05-07 14:41:00 +0500
commit44ad7495bb719aa6add337a46354cce735e1d952 (patch)
tree1ea6a6e97325395fbc2c087725413c57f9ec6ff0 /strings/decimal.c
parent46cf8b5a6a83a71708d712e3770286ab3faaf009 (diff)
downloadmariadb-git-44ad7495bb719aa6add337a46354cce735e1d952.tar.gz
Fix for bug #9527 (negative zero is a nonsence)
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 7459b2f7dda..3fa06132cf1 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1924,6 +1924,17 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
for (; carry; buf0--)
ADD(*buf0, *buf0, 0, carry);
}
+
+ /* Now we have to check for -0.000 case */
+ if (to->sign)
+ {
+ dec1 *buf= to->buf;
+ dec1 *end= to->buf + intg0 + frac0;
+ for (; (buf<end) && !*buf; buf++);
+ if (buf == end)
+ /* So we got decimal zero */
+ decimal_make_zero(to);
+ }
return error;
}