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-06-30 11:43:02 +0200
commitc87e002bbb946907b4c9504612b3b3c2a0a19e51 (patch)
tree56dbde4734e34556a1a41acfadb8e457e7588a45 /strings
parentda372fb9dc33e6b3ca65b7454aaec2b5c9bd9d73 (diff)
downloadmariadb-git-c87e002bbb946907b4c9504612b3b3c2a0a19e51.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 c958a366957..7db5111fc84 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: