summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorserg@serg.mylan <>2005-12-23 20:50:28 +0100
committerserg@serg.mylan <>2005-12-23 20:50:28 +0100
commitc0638190759a616adc447207e18c155c81132ee9 (patch)
tree2594fb169d9c168d8ecb0490a4bbebd32149426e /strings/decimal.c
parentb867ef6df010e1fdc9da4c20f8c0fa56147ae7b5 (diff)
downloadmariadb-git-c0638190759a616adc447207e18c155c81132ee9.tar.gz
locking issues,
test for LONGLONG_MIN in decimal.c
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index 0c1f03016e0..5fb37d374a2 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -1069,9 +1069,9 @@ int decimal2longlong(decimal_t *from, longlong *to)
}
}
/* boundary case: 9223372036854775808 */
- if (unlikely(from->sign==0 && x < 0 && -x < 0))
+ if (unlikely(from->sign==0 && x == LONGLONG_MIN))
{
- *to= -1-x;
+ *to= LONGLONG_MAX;
return E_DEC_OVERFLOW;
}
@@ -2675,7 +2675,8 @@ void test_pr(const char *s1, int prec, int dec, char filler, const char *orig,
int slen= sizeof(s2);
int res;
- sprintf(s, "'%s', %d, %d, '%c'", s1, prec, dec, filler);
+ sprintf(s, filler ? "'%s', %d, %d, '%c'" : "'%s', %d, %d, '\\0'",
+ s1, prec, dec, filler);
end= strend(s1);
string2decimal(s1, &a, &end);
res= decimal2string(&a, s2, &slen, prec, dec, filler);