mirror of
https://github.com/MariaDB/server.git
synced 2025-05-25 13:42:52 +03:00
Fix for bug #9527 (negative zero is a nonsence)
strings/decimal.c: added the check to make sure we don't ge -0.00
This commit is contained in:
parent
0228f89725
commit
77cb61d2cf
@ -1924,6 +1924,17 @@ int decimal_mul(decimal_t *from1, decimal_t *from2, decimal_t *to)
|
|||||||
for (; carry; buf0--)
|
for (; carry; buf0--)
|
||||||
ADD(*buf0, *buf0, 0, carry);
|
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;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user