summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-06-26 13:37:27 +0200
committerSergei Golubchik <serg@mariadb.org>2016-12-05 10:28:20 +0100
commit02d153c7b9739ce4c2445805aeaf4b185c6ac6f0 (patch)
treee756a7089348c400ce4bbfe87d19f3fcb6b47559 /strings
parent4a3acbcfd07291ecc141f37200eec79eb1713882 (diff)
downloadmariadb-git-02d153c7b9739ce4c2445805aeaf4b185c6ac6f0.tar.gz
str2decimal: don't return a negative zero
Diffstat (limited to 'strings')
-rw-r--r--strings/decimal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index b0c57d3db0c..3d90a58ea8a 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -928,6 +928,8 @@ internal_str2dec(const char *from, decimal_t *to, char **end, my_bool fixed)
error= decimal_shift(to, (int) exponent);
}
}
+ if (to->sign && decimal_is_zero(to))
+ to->sign= 0;
return error;
fatal_error: