summaryrefslogtreecommitdiff
path: root/strings/decimal.c
diff options
context:
space:
mode:
authorhf@deer.(none) <>2005-07-29 14:39:11 +0500
committerhf@deer.(none) <>2005-07-29 14:39:11 +0500
commitceb75aed656fb84394811b07bbd68c74d62e9770 (patch)
tree459f5b5814d50b6a5a57f71564693351e7cf5387 /strings/decimal.c
parente60d786dde7bfec95a16967bb57d8c570af8ac9e (diff)
downloadmariadb-git-ceb75aed656fb84394811b07bbd68c74d62e9770.tar.gz
Fix for bug #12173 (show create table crash)
Diffstat (limited to 'strings/decimal.c')
-rw-r--r--strings/decimal.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/strings/decimal.c b/strings/decimal.c
index ca92ace92e1..4dc5fa91e0a 100644
--- a/strings/decimal.c
+++ b/strings/decimal.c
@@ -351,7 +351,8 @@ int decimal2string(decimal_t *from, char *to, int *to_len,
buf0=&tmp;
}
- intg_len= fixed_precision ? fixed_intg : (intg ? intg : 1);
+ if (!(intg_len= fixed_precision ? fixed_intg : intg))
+ intg_len= 1;
frac_len= fixed_precision ? fixed_decimals : frac;
len= from->sign + intg_len + test(frac) + frac_len;
if (fixed_precision)