summaryrefslogtreecommitdiff
path: root/sql/my_decimal.h
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2005-06-08 21:56:22 +0500
committerunknown <hf@deer.(none)>2005-06-08 21:56:22 +0500
commitb7e3f09264f68de5afcd25550aee2116ac5eb52f (patch)
treeb006d4d0d80d76393f851fb0be36971a276bab37 /sql/my_decimal.h
parent2c1e5d8ef13a3f1eeef87fa70d26b0006146bd64 (diff)
downloadmariadb-git-b7e3f09264f68de5afcd25550aee2116ac5eb52f.tar.gz
Fix for bug #10896 (0.00 > -0.00)
mysql-test/r/type_newdecimal.result: test result fixed mysql-test/t/type_newdecimal.test: test case added sql/my_decimal.h: we neede to check for zero here not to get -0.00
Diffstat (limited to 'sql/my_decimal.h')
-rw-r--r--sql/my_decimal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/my_decimal.h b/sql/my_decimal.h
index 27fd33cffbe..b65e6aedaa2 100644
--- a/sql/my_decimal.h
+++ b/sql/my_decimal.h
@@ -290,6 +290,11 @@ int int2my_decimal(uint mask, longlong i, my_bool unsigned_flag, my_decimal *d)
inline
void my_decimal_neg(decimal_t *arg)
{
+ if (decimal_is_zero(arg))
+ {
+ arg->sign= 0;
+ return;
+ }
decimal_neg(arg);
}